Browse Source

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

BattleAI: fix freeze
Ivan Savenko 2 năm trước cách đây
mục cha
commit
f6a4a1ae0c
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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
 	auto stacks = hb->battleGetUnitsIf([=](const battle::Unit * u) -> bool
 		{
 		{
-			return true;
+			return u->isValidTarget();
 		});
 		});
 
 
 	std::vector<const battle::Unit *> ourUnits, enemyUnits;
 	std::vector<const battle::Unit *> ourUnits, enemyUnits;