Browse Source

BattleAI: fix freeze

Andrii Danylchenko 2 years ago
parent
commit
4b807e01f1
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;