mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
commit
727cd2e9e1
@ -376,11 +376,14 @@ MoveTarget BattleExchangeEvaluator::findMoveTowardsUnreachable(
|
||||
logAi->trace("New high score");
|
||||
#endif
|
||||
|
||||
for(BattleHex enemyHex : enemy->getAttackableHexes(activeStack))
|
||||
for(const BattleHex & initialEnemyHex : enemy->getAttackableHexes(activeStack))
|
||||
{
|
||||
while(!flying && dists.distances[enemyHex] > speed)
|
||||
BattleHex enemyHex = initialEnemyHex;
|
||||
|
||||
while(!flying && dists.distances[enemyHex] > speed && dists.predecessors.at(enemyHex).isValid())
|
||||
{
|
||||
enemyHex = dists.predecessors.at(enemyHex);
|
||||
|
||||
if(dists.accessibility[enemyHex] == EAccessibility::ALIVE_STACK)
|
||||
{
|
||||
auto defenderToBypass = hb->battleGetUnitByPos(enemyHex);
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
|
||||
bool checkVanquished() const
|
||||
{
|
||||
return ownedObjects.empty();
|
||||
return getHeroes().empty() && getTowns().empty();
|
||||
}
|
||||
|
||||
template <typename Handler> void serialize(Handler &h)
|
||||
|
Loading…
Reference in New Issue
Block a user