mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix handling damage in bridge in fortress (#349)
Remove "Moat" obstacle on bridge hex from affected obstacles by creature, when bridge is opened/destroyed. Resolves: https://bugs.vcmi.eu/view.php?id=2577
This commit is contained in:
parent
2e2642ef7a
commit
b56d05b75b
@ -836,6 +836,12 @@ std::vector<std::shared_ptr<const CObstacleInstance>> CBattleInfoCallback::getAl
|
||||
for(auto & i : battleGetAllObstaclesOnPos(otherHex, false))
|
||||
affectedObstacles.push_back(i);
|
||||
}
|
||||
for(auto hex : stack->getHexes())
|
||||
if(hex == ESiegeHex::GATE_BRIDGE)
|
||||
if(battleGetGateState() == EGateState::OPENED || battleGetGateState() == EGateState::DESTROYED)
|
||||
for(int i=0; i<affectedObstacles.size(); i++)
|
||||
if(affectedObstacles.at(i)->obstacleType == CObstacleInstance::MOAT)
|
||||
affectedObstacles.erase(affectedObstacles.begin()+i);
|
||||
}
|
||||
return affectedObstacles;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user