Browse Source

Merge pull request #2686 from vcmi/fix-battle-freeze

BattleAI: fix freeze
Ivan Savenko 2 years ago
parent
commit
f6a4a1ae0c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      AI/BattleAI/AttackPossibility.cpp

+ 1 - 1
AI/BattleAI/AttackPossibility.cpp

@@ -30,7 +30,7 @@ void DamageCache::buildDamageCache(std::shared_ptr<HypotheticBattle> hb, int sid
 {
 	auto stacks = hb->battleGetUnitsIf([=](const battle::Unit * u) -> bool
 		{
-			return true;
+			return u->isValidTarget();
 		});
 
 	std::vector<const battle::Unit *> ourUnits, enemyUnits;