From 6bd442e6f16dccda0969ff30e961c096ab59ab5d Mon Sep 17 00:00:00 2001 From: Xilmi Date: Tue, 13 Aug 2024 23:43:56 +0200 Subject: [PATCH] BattleAI: Fix endless loop Fixed an issue where the part of a 2-tile-unit that is outside of the map was considered a target and caused an endless-loop in the pathfinding being unable to get there. --- AI/BattleAI/AttackPossibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AI/BattleAI/AttackPossibility.cpp b/AI/BattleAI/AttackPossibility.cpp index d663a1bf4..ced430425 100644 --- a/AI/BattleAI/AttackPossibility.cpp +++ b/AI/BattleAI/AttackPossibility.cpp @@ -245,7 +245,7 @@ AttackPossibility AttackPossibility::evaluate( std::vector defenderHex; if(attackInfo.shooting) - defenderHex = defender->getHexes(); + defenderHex.push_back(defender->getPosition()); else defenderHex = CStack::meleeAttackHexes(attacker, defender, hex);