From cca46e311d240ec3489d5c31708a4b42cb36e828 Mon Sep 17 00:00:00 2001 From: "Fior.in" Date: Wed, 12 Sep 2018 20:33:34 -0300 Subject: [PATCH] Fixed schemas for battle animation overwritting an solo attribute instead images attribute dependant. Now working for replacing battle sprites on pre-existant heroes too (#490) --- config/schemas/hero.json | 10 +++++----- lib/CHeroHandler.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/schemas/hero.json b/config/schemas/hero.json index 68c3a474a..e584d2fb4 100644 --- a/config/schemas/hero.json +++ b/config/schemas/hero.json @@ -59,6 +59,11 @@ "type":"boolean", "description": "This hero is female (changeable via editor)" }, + "battleImage": { + "type":"string", + "description": "Custom def used on battle", + "format" : "defFile" + }, "images": { "type":"object", "additionalProperties" : false, @@ -84,11 +89,6 @@ "type":"string", "description": "Small image of hero specialty for use in exchange screen", "format" : "imageFile" - }, - "battleImage": { - "type":"string", - "description": "Custom def used on battle", - "format" : "defFile" } } }, diff --git a/lib/CHeroHandler.cpp b/lib/CHeroHandler.cpp index 12231c508..28aff408d 100644 --- a/lib/CHeroHandler.cpp +++ b/lib/CHeroHandler.cpp @@ -322,7 +322,7 @@ CHero * CHeroHandler::loadFromJson(const JsonNode & node, const std::string & id hero->iconSpecLarge = node["images"]["specialtyLarge"].String(); hero->portraitSmall = node["images"]["small"].String(); hero->portraitLarge = node["images"]["large"].String(); - hero->battleImage = node["images"]["battleImage"].String(); + hero->battleImage = node["battleImage"].String(); loadHeroArmy(hero, node); loadHeroSkills(hero, node);