1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

vcmi: remove ONLY_ENEMY_ARMY range

It should be used directly instead of alias, propagation updater
also can be useful for any other updaters can be added.
This commit is contained in:
Konstantin
2023-03-09 13:05:47 +03:00
parent af2cb61077
commit b91d7418dd
7 changed files with 59 additions and 73 deletions

View File

@@ -1225,13 +1225,6 @@ void CGTownInstance::recreateBuildingsBonuses()
for(auto & bonus : building->buildingBonuses)
{
if(bonus->limiter && bonus->effectRange == Bonus::ONLY_ENEMY_ARMY) //ONLY_ENEMY_ARMY is only mark for OppositeSide limiter to avoid extra dynamic_cast.
{
auto bCopy = std::make_shared<Bonus>(*bonus); //just a copy of the shared_ptr has been changed and reassigned.
bCopy->limiter = std::make_shared<OppositeSideLimiter>(this->getOwner());
addNewBonus(bCopy);
continue;
}
if(bonus->propagator != nullptr && bonus->propagator->getPropagatorType() == ALL_CREATURES)
VLC->creh->addBonusForAllCreatures(bonus);
else