Browse Source

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)

Fior.in 7 years ago
parent
commit
cca46e311d
2 changed files with 6 additions and 6 deletions
  1. 5 5
      config/schemas/hero.json
  2. 1 1
      lib/CHeroHandler.cpp

+ 5 - 5
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"
 				}
 			}
 		},

+ 1 - 1
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);