1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

vcmi: slightly rework limiters

1. Add vector to aggregates
2. Rework CreatureFactionLimiter to FactionLimiter
This commit is contained in:
Konstantin
2023-04-09 04:36:16 +03:00
parent 7326980bd4
commit dd196f2aa8
7 changed files with 75 additions and 36 deletions

View File

@@ -569,9 +569,9 @@ void CTownHandler::loadSpecialBuildingBonuses(const JsonNode & source, BonusList
if(bonus->limiter != nullptr)
{
auto * limPtr = dynamic_cast<CreatureFactionLimiter *>(bonus->limiter.get());
auto * limPtr = dynamic_cast<FactionLimiter *>(bonus->limiter.get());
if(limPtr != nullptr && limPtr->faction == FactionID::ANY)
if(limPtr != nullptr && limPtr->faction == FactionID::DEFAULT)
limPtr->faction = building->town->faction->getId();
}
//JsonUtils::parseBuildingBonus produces UNKNOWN type propagator instead of empty.