1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-08 00:39:47 +02:00

Fix movement over lowered drawbridge in Fortress

This commit is contained in:
Ivan Savenko 2023-03-25 17:22:42 +02:00
parent 2167cb2a68
commit 8fbeff2a02

View File

@ -1004,12 +1004,19 @@ std::set<BattleHex> CBattleInfoCallback::getStoppers(BattlePerspective::BattlePe
for(auto &oi : battleGetAllObstacles(whichSidePerspective)) for(auto &oi : battleGetAllObstacles(whichSidePerspective))
{ {
if(battleIsObstacleVisibleForSide(*oi, whichSidePerspective)) if(!battleIsObstacleVisibleForSide(*oi, whichSidePerspective))
continue;
for(const auto & hex : oi->getStoppingTile())
{ {
range::copy(oi->getStoppingTile(), vstd::set_inserter(ret)); if(hex == ESiegeHex::GATE_BRIDGE && oi->obstacleType == CObstacleInstance::MOAT)
{
if(battleGetGateState() == EGateState::OPENED || battleGetGateState() == EGateState::DESTROYED)
continue; // this tile is disabled by drawbridge on top of it
}
ret.insert(hex);
} }
} }
return ret; return ret;
} }