1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-17 20:58:07 +02:00

Fixes BattleAI not selecting best hex when approaching nearest enemy

This commit is contained in:
Ivan Savenko 2025-01-19 16:38:50 +00:00
parent ed70e94f9a
commit 2d6ae7859b

View File

@ -390,7 +390,7 @@ BattleAction BattleEvaluator::goTowardsNearest(const CStack * stack, const Battl
return reachability.distances[h1.toInt()] < reachability.distances[h2.toInt()];
});
BattleHex bestNeighbour = hexes.front();
BattleHex bestNeighbour = targetHexes.front();
if(reachability.distances[bestNeighbour.toInt()] > GameConstants::BFIELD_SIZE)
{