1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Use sight center for fow reveal actions

This commit is contained in:
Ivan Savenko 2024-05-10 16:48:44 +00:00
parent 19f2fbce1e
commit 145cd38025

View File

@ -900,7 +900,7 @@ void CGameHandler::onNewTurn()
{ {
if (getPlayerStatus(player.first) == EPlayerStatus::INGAME && if (getPlayerStatus(player.first) == EPlayerStatus::INGAME &&
getPlayerRelations(player.first, t->tempOwner) == PlayerRelations::ENEMIES) getPlayerRelations(player.first, t->tempOwner) == PlayerRelations::ENEMIES)
changeFogOfWar(t->visitablePos(), t->getFirstBonus(Selector::type()(BonusType::DARKNESS))->val, player.first, ETileVisibility::HIDDEN); changeFogOfWar(t->getSightCenter(), t->getFirstBonus(Selector::type()(BonusType::DARKNESS))->val, player.first, ETileVisibility::HIDDEN);
} }
} }
} }
@ -1550,7 +1550,7 @@ void CGameHandler::giveHero(ObjectInstanceID id, PlayerColor player, ObjectInsta
//Reveal fow around new hero, especially released from Prison //Reveal fow around new hero, especially released from Prison
auto h = getHero(id); auto h = getHero(id);
changeFogOfWar(h->pos, h->getSightRadius(), player, ETileVisibility::REVEALED); changeFogOfWar(h->getSightCenter(), h->getSightRadius(), player, ETileVisibility::REVEALED);
} }
void CGameHandler::changeObjPos(ObjectInstanceID objid, int3 newPos, const PlayerColor & initiator) void CGameHandler::changeObjPos(ObjectInstanceID objid, int3 newPos, const PlayerColor & initiator)