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

HasChargesLimiter now works in "bonuses" json section

This commit is contained in:
SoundSSGood
2025-06-24 01:23:07 +02:00
parent 7f9936cf10
commit 76debab846
7 changed files with 35 additions and 37 deletions

View File

@@ -259,6 +259,20 @@ std::shared_ptr<CArtifact> CArtHandler::loadFromJson(const std::string & scope,
}
}
// Some bonuses must be located in the instance.
for(const auto & b : art->getExportedBonusList())
{
if(std::dynamic_pointer_cast<const HasChargesLimiter>(b->limiter))
{
b->source = BonusSource::ARTIFACT;
b->duration = BonusDuration::PERMANENT;
b->description.appendTextID(art->getNameTextID());
b->description.appendRawString(" %+d");
art->instanceBonuses.push_back(b);
art->removeBonus(b);
}
}
return art;
}