1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00
This commit is contained in:
Michał W. Urbańczyk
2013-05-27 21:46:04 +00:00
parent b01637840a
commit 9f5d1ba623
8 changed files with 89 additions and 25 deletions

View File

@@ -6154,6 +6154,15 @@ void CGameHandler::removeAfterVisit(const CGObjectInstance *object)
assert("This function needs to be called during the object visit!");
}
bool CGameHandler::isVisitCoveredByAnotherQuery(const CGObjectInstance *obj, const CGHeroInstance *hero)
{
if(auto topQuery = queries.topQuery(hero->getOwner()))
if(auto visit = std::dynamic_pointer_cast<const CObjectVisitQuery>(topQuery))
return !(visit->visitedObject == obj && visit->visitingHero == hero);
return true;
}
CasualtiesAfterBattle::CasualtiesAfterBattle(const CArmedInstance *army, BattleInfo *bat)
{
heroWithDeadCommander = ObjectInstanceID();