mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
CBattleInfoCallback: use obstacle only once
We should not affect creature by obstacle twice.
This commit is contained in:
@@ -810,6 +810,7 @@ std::vector<std::shared_ptr<const CObstacleInstance>> CBattleInfoCallback::getAl
|
|||||||
BattleHex otherHex = unit->occupiedHex(unit->getPosition());
|
BattleHex otherHex = unit->occupiedHex(unit->getPosition());
|
||||||
if(otherHex.isValid())
|
if(otherHex.isValid())
|
||||||
for(auto & i : battleGetAllObstaclesOnPos(otherHex, false))
|
for(auto & i : battleGetAllObstaclesOnPos(otherHex, false))
|
||||||
|
if(!vstd::contains(affectedObstacles, i))
|
||||||
affectedObstacles.push_back(i);
|
affectedObstacles.push_back(i);
|
||||||
}
|
}
|
||||||
for(auto hex : unit->getHexes())
|
for(auto hex : unit->getHexes())
|
||||||
|
Reference in New Issue
Block a user