mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
BattleAI: fix bypassing 2-hex moat
This commit is contained in:
parent
ae69311023
commit
0935f931fa
@ -64,6 +64,18 @@ std::vector<BattleHex> BattleEvaluator::getBrokenWallMoatHexes() const
|
||||
auto moatHex = wallHex.cloneInDirection(BattleHex::LEFT);
|
||||
|
||||
result.push_back(moatHex);
|
||||
|
||||
moatHex = moatHex.cloneInDirection(BattleHex::LEFT);
|
||||
auto obstaclesSecondRow = cb->getBattle(battleID)->battleGetAllObstaclesOnPos(moatHex, false);
|
||||
|
||||
for(auto obstacle : obstaclesSecondRow)
|
||||
{
|
||||
if(obstacle->obstacleType == CObstacleInstance::EObstacleType::MOAT)
|
||||
{
|
||||
result.push_back(moatHex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user