Explorar o código

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

BattleAI: fix freeze
Ivan Savenko %!s(int64=2) %!d(string=hai) anos
pai
achega
f6a4a1ae0c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;