1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Moved FoW management from CGObjectInstance to callback

This commit is contained in:
Ivan Savenko
2014-06-24 14:50:27 +03:00
parent 5ebc0e8614
commit ad632d1e8a
10 changed files with 43 additions and 46 deletions

View File

@ -1048,7 +1048,12 @@ void CGObservatory::onHeroVisit( const CGHeroInstance * h ) const
case Obj::COVER_OF_DARKNESS:
{
iw.text.addTxt (MetaString::ADVOB_TXT, 31);
hideTiles(h->tempOwner, 20);
for (auto player : cb->gameState()->players)
{
if (cb->getPlayerStatus(player.first) == EPlayerStatus::INGAME &&
cb->getPlayerRelations(player.first, h->tempOwner) == PlayerRelations::ENEMIES)
cb->changeFogOfWar(visitablePos(), 20, player.first, true);
}
break;
}
}