mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
vcmi: adjust parseBonus and Bonus::toJson
This was an error, when scheme and parser asks different values for source type. Corrected this.
This commit is contained in:
parent
129b5313c5
commit
b99a2ad669
@ -1708,7 +1708,7 @@ JsonNode Bonus::toJsonNode() const
|
||||
if(turnsRemain != 0)
|
||||
root["turns"].Integer() = turnsRemain;
|
||||
if(source != OTHER)
|
||||
root["source"].String() = vstd::findKey(bonusSourceMap, source);
|
||||
root["sourceType"].String() = vstd::findKey(bonusSourceMap, source);
|
||||
if(sid != 0)
|
||||
root["sourceID"].Integer() = sid;
|
||||
if(val != 0)
|
||||
|
@ -845,7 +845,7 @@ bool JsonUtils::parseBonus(const JsonNode &ability, Bonus *b)
|
||||
}
|
||||
}
|
||||
|
||||
value = &ability["source"];
|
||||
value = &ability["sourceType"];
|
||||
if (!value->isNull())
|
||||
b->source = static_cast<Bonus::BonusSource>(parseByMap(bonusSourceMap, value, "source type "));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user