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

Rewardable town buildings prototype

This commit is contained in:
nordsoft
2023-04-30 03:58:43 +04:00
parent 3df0ce229e
commit 2adcc89a0d
6 changed files with 39 additions and 4 deletions

View File

@@ -627,6 +627,12 @@ void CTownHandler::loadBuilding(CTown * town, const std::string & stringID, cons
for(auto & bonus : ret->onVisitBonuses)
bonus->sid = Bonus::getSid32(ret->town->faction->getIndex(), ret->bid);
}
if(!source["rewards"].isNull() && ret->subId == BuildingSubID::NONE)
{
ret->subId = BuildingSubID::CONFIGURABLE_REWARD;
ret->rewardableObjectInfo.init(source["rewards"]);
}
}
//MODS COMPATIBILITY FOR 0.96
if(!ret->produce.nonZero())