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

Implemented tracking of objects destroyed by players

This commit is contained in:
Ivan Savenko
2024-01-31 01:37:33 +02:00
parent ccea7fc1fb
commit 2e4895766a
13 changed files with 44 additions and 53 deletions

View File

@ -1420,10 +1420,7 @@ bool CGameState::checkForVictory(const PlayerColor & player, const EventConditio
{
if (condition.objectID != ObjectInstanceID::NONE) // mode A - destroy specific object of this type
{
if(const auto * hero = getHero(condition.objectID))
return boost::range::find(gs->map->heroesOnMap, hero) == gs->map->heroesOnMap.end();
else
return getObj(condition.objectID) == nullptr;
return p->destroyedObjects.count(condition.objectID);
}
else
{