1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00

Fix regression for week-visitable objects

This commit is contained in:
Piotr Wójcik
2016-09-28 19:07:48 +02:00
committed by AlexVinS
parent 6664731886
commit bb890098df
3 changed files with 62 additions and 26 deletions

View File

@ -323,7 +323,18 @@ DLL_LINKAGE void ChangeObjectVisitors::applyGs( CGameState *gs )
break;
case VISITOR_CLEAR:
for (CGHeroInstance * hero : gs->map->allHeroes)
hero->visitedObjects.erase(object); // remove visit info from all heroes, including those that are not present on map
{
if (hero)
{
hero->visitedObjects.erase(object); // remove visit info from all heroes, including those that are not present on map
}
}
for(auto &elem : gs->players)
{
elem.second.visitedObjects.erase(object);
}
break;
case VISITOR_REMOVE:
gs->getHero(hero)->visitedObjects.erase(object);