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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user