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

Improve selection of bonus when bonus grouping is active

This commit is contained in:
Ivan Savenko
2025-05-22 14:56:22 +03:00
parent 9975852d33
commit 5e02d2a3be
2 changed files with 45 additions and 7 deletions

View File

@@ -247,7 +247,8 @@ void CTownHandler::loadBuildingBonuses(const JsonNode & source, BonusList & bonu
if(!JsonUtils::parseBonus(b, bonus.get()))
continue;
bonus->description.appendTextID(building->getNameTextID());
if (bonus->description.empty() && (bonus->type == BonusType::MORALE || bonus->type == BonusType::LUCK))
bonus->description.appendTextID(building->getNameTextID());
//JsonUtils::parseBuildingBonus produces UNKNOWN type propagator instead of empty.
assert(bonus->propagator == nullptr || bonus->propagator->getPropagatorType() != CBonusSystemNode::ENodeTypes::UNKNOWN);