mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-29 00:41:38 +02:00
Spell configuration: introduce simplifaction mechanism for level conficuration
* also aviable for other handlers
This commit is contained in:
@ -864,6 +864,22 @@ void CSpellHandler::afterLoadFinalization()
|
||||
bonus.sid = spell->id;
|
||||
}
|
||||
|
||||
void CSpellHandler::beforeValidate(JsonNode & object)
|
||||
{
|
||||
//handle "base" level info
|
||||
|
||||
JsonNode levels = object["levels"];
|
||||
|
||||
if(levels["base"].getType() == JsonNode::DATA_STRUCT)
|
||||
{
|
||||
JsonUtils::mergeCopy(levels["none"],levels["base"]);
|
||||
JsonUtils::mergeCopy(levels["basic"],levels["base"]);
|
||||
JsonUtils::mergeCopy(levels["advanced"],levels["base"]);
|
||||
JsonUtils::mergeCopy(levels["expert"],levels["base"]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
CSpellHandler::~CSpellHandler()
|
||||
|
Reference in New Issue
Block a user