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

Resolve problem with unwanted propagation of abilities descriptions

This commit is contained in:
Opuszek
2025-08-21 19:38:30 +02:00
parent 154645da68
commit aeab0fda0b
7 changed files with 221 additions and 19 deletions

View File

@@ -142,6 +142,7 @@ void CBonusTypeHandler::loadItem(const JsonNode & source, CBonusType & dest, con
dest.identifier = name;
dest.hidden = source["hidden"].Bool(); //Null -> false
dest.creatureNature = source["creatureNature"].Bool(); //Null -> false
dest.propagateDescription = source["propagateDescription"].isNull() ? true : source["propagateDescription"].Bool(); //Null -> true
if (!dest.hidden)
LIBRARY->generaltexth->registerString( "vcmi", dest.getDescriptionTextID(), source["description"]);
@@ -196,6 +197,12 @@ bool CBonusTypeHandler::isCreatureNatureBonus(BonusType bonus) const
return bonusTypes.at(static_cast<int>(bonus))->creatureNature;
}
bool CBonusTypeHandler::shouldPropagateDescription(BonusType bonus) const
{
return bonusTypes.at(static_cast<int>(bonus))->propagateDescription;
}
std::vector<BonusType> CBonusTypeHandler::getAllObjets() const
{
std::vector<BonusType> ret;