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

converted castle.json; fixed bugs in Bonus::toJsonNode()

This commit is contained in:
Henning Koehler
2017-09-17 10:02:04 +12:00
parent 00f51e0f98
commit dc7132d8b7
2 changed files with 265 additions and 63 deletions

View File

@@ -1173,7 +1173,7 @@ JsonNode subtypeToJson(Bonus::BonusType type, int subtype)
case Bonus::SPECIAL_UPGRADE:
return JsonUtils::stringNode("creature." + CreatureID::encode(subtype));
case Bonus::GENERATE_RESOURCE:
return JsonUtils::stringNode(GameConstants::RESOURCE_NAMES[subtype]);
return JsonUtils::stringNode("resource." + GameConstants::RESOURCE_NAMES[subtype]);
default:
return JsonUtils::intNode(subtype);
}
@@ -1202,7 +1202,7 @@ JsonNode Bonus::toJsonNode() const
if(val != 0)
root["val"].Integer() = val;
if(valType != ADDITIVE_VALUE)
root["valType"].String() = vstd::findKey(bonusValueMap, valType);
root["valueType"].String() = vstd::findKey(bonusValueMap, valType);
if(limiter)
root["limiters"].Vector().push_back(limiter->toJsonNode());
if(updater)