Browse Source

Merge pull request #2145 from IvanSavenko/fix_hota_support

Minor fixed for compatibility with hota data files
Ivan Savenko 2 years ago
parent
commit
9817aaa466

+ 2 - 2
client/CMusicHandler.cpp

@@ -335,7 +335,7 @@ CMusicHandler::CMusicHandler():
 
 	auto mp3files = CResourceHandler::get()->getFilteredFiles([](const ResourceID & id) ->  bool
 	{
-		if(id.getType() != EResType::MUSIC)
+		if(id.getType() != EResType::SOUND)
 			return false;
 
 		if(!boost::algorithm::istarts_with(id.getName(), "MUSIC/"))
@@ -561,7 +561,7 @@ void MusicEntry::load(std::string musicURI)
 
 	try
 	{
-		auto musicFile = MakeSDLRWops(CResourceHandler::get()->load(ResourceID(std::move(musicURI), EResType::MUSIC)));
+		auto musicFile = MakeSDLRWops(CResourceHandler::get()->load(ResourceID(std::move(musicURI), EResType::SOUND)));
 		music = Mix_LoadMUS_RW(musicFile, SDL_TRUE);
 	}
 	catch(std::exception &e)

+ 1 - 1
client/render/CDefFile.cpp

@@ -142,13 +142,13 @@ CDefFile::CDefFile(std::string Name):
 		palette[6] = H3Palette[6];
 		palette[7] = H3Palette[7];
 		break;
-	case DefType::MAP:
 	case DefType::MAP_HERO:
 		palette[0] = H3Palette[0];
 		palette[1] = H3Palette[1];
 		palette[4] = H3Palette[4];
 		//5 = owner flag, handled separately
 		break;
+	case DefType::MAP:
 	case DefType::TERRAIN:
 		palette[0] = H3Palette[0];
 		palette[1] = H3Palette[1];

+ 9 - 9
config/factions/castle.json

@@ -84,10 +84,10 @@
 				"mageGuild3":     { "animation" : "TBCSMAG3.def", "x" : 704, "y" : 107, "z" : 1, "border" : "TOCSM301.bmp", "area" : "TZCSM301.bmp" },
 				"mageGuild4":     { "animation" : "TBCSMAG4.def", "x" : 704, "y" : 76,  "z" : 1, "border" : "TOCSM401.bmp", "area" : "TZCSM401.bmp" },
 				"tavern":         { "animation" : "TBCSTVRN.def", "x" : 0,   "y" : 230, "z" : 1, "border" : "TOCSTAV1.bmp", "area" : "TZCSTAV1.bmp" },
-				"shipyard":       { "animation" : "TBCSDOCK.def", "x" : 478, "y" : 134, "z" : 1, "border" : "TOCSDKMS.bmp", "area" : "TZCSDKMS.bmp" },
-				"fort":           { "animation" : "TBCSCSTL.def", "x" : 595, "y" : 66,  "border" : "TOCSCAS1.bmp", "area" : "TZCSCAS1.bmp" },
-				"citadel":        { "animation" : "TBCSCAS2.def", "x" : 478, "y" : 66,  "border" : "TOCSCAS2.bmp", "area" : "TZCSCAS2.bmp" },
-				"castle":         { "animation" : "TBCSCAS3.def", "x" : 478, "y" : 37,  "border" : "TOCSCAS3.bmp", "area" : "TZCSCAS3.bmp" },
+				"shipyard":       { "animation" : "TBCSDOCK.def", "x" : 478, "y" : 134, "z" : -3, "border" : "TOCSDKMS.bmp", "area" : "TZCSDKMS.bmp" },
+				"fort":           { "animation" : "TBCSCSTL.def", "x" : 595, "y" : 66,  "z" : -4, "border" : "TOCSCAS1.bmp", "area" : "TZCSCAS1.bmp" },
+				"citadel":        { "animation" : "TBCSCAS2.def", "x" : 478, "y" : 66,  "z" : -4, "border" : "TOCSCAS2.bmp", "area" : "TZCSCAS2.bmp" },
+				"castle":         { "animation" : "TBCSCAS3.def", "x" : 478, "y" : 37,  "z" : -4, "border" : "TOCSCAS3.bmp", "area" : "TZCSCAS3.bmp" },
 				"villageHall":    { "animation" : "TBCSHALL.def", "x" : 0,   "y" : 209, "border" : "TOCSH101.bmp", "area" : "TZCSH101.bmp" },
 				"townHall":       { "animation" : "TBCSHAL2.def", "x" : 0,   "y" : 176, "border" : "TOCSH201.bmp", "area" : "TZCSH201.bmp" },
 				"cityHall":       { "animation" : "TBCSHAL3.def", "x" : 0,   "y" : 164, "border" : "TOCSH301.bmp", "area" : "TZCSH301.bmp" },
@@ -95,21 +95,21 @@
 				"marketplace":    { "animation" : "TBCSMARK.def", "x" : 413, "y" : 264, "border" : "TOCSMRK1.bmp", "area" : "TZCSMRK1.bmp" },
 				"resourceSilo":   { "animation" : "TBCSSILO.def", "x" : 488, "y" : 228, "border" : "TOCSMRK2.bmp", "area" : "TZCSMRK2.bmp" },
 				"blacksmith":     { "animation" : "TBCSBLAK.def", "x" : 213, "y" : 251, "border" : "TOCSBLAK.bmp", "area" : "TZCSBLAK.bmp" },
-				"special1":       { "animation" : "TBCSSPEC.def", "x" : 533, "y" : 71,  "border" : "TOCSLT01.bmp", "area" : "TZCSLT01.bmp" },
+				"special1":       { "animation" : "TBCSSPEC.def", "x" : 533, "y" : 71,  "z" : -3, "border" : "TOCSLT01.bmp", "area" : "TZCSLT01.bmp" },
 				"horde1":         { "animation" : "TBCSHRD1.def", "x" : 76,  "y" : 53,  "z" : -1, "border" : "TOCSGR1H.bmp", "area" : "TZCSGR1H.bmp", "hidden" : true },
 				"horde1Upgr":     { "animation" : "TBCSHRD2.def", "x" : 76,  "y" : 35,  "z" : -1, "border" : "TOCSGR2H.bmp", "area" : "TZCSGR2H.bmp", "hidden" : true, "builds" : "horde1" },
-				"ship":           { "animation" : "TBCSBOAT.def", "x" : 478, "y" : 134, "z" : 1, "border" : "TOCSDKMN.bmp", "area" : "TZCSDKMN.bmp", "hidden" : true },
+				"ship":           { "animation" : "TBCSBOAT.def", "x" : 478, "y" : 134, "z" : -3, "border" : "TOCSDKMN.bmp", "area" : "TZCSDKMN.bmp", "hidden" : true },
 				"special2":       { "animation" : "TBCSEXT0.def", "x" : 384, "y" : 193, "z" : -2, "border" : "TOCSCAVM.bmp", "area" : "TZCSCAVM.bmp" },
 				"special3":       { "animation" : "TBCSEXT1.def", "x" : 0,   "y" : 198, "z" :  1, "border" : "TOCSTAV2.bmp", "area" : "TZCSTAV2.bmp" },
-				"grail":          { "animation" : "TBCSHOLY.def", "x" : 456, "y" : 109, "z" : -1, "border" : "TOCSHOLY.bmp", "area" : "TZCSHOLY.bmp" },
-				"dwellingLvl1":   { "animation" : "TBCSDW_0.def", "x" : 304, "y" : 92,  "border" : "TOCSPIK1.bmp", "area" : "TZCSPIK1.bmp" },
+				"grail":          { "animation" : "TBCSHOLY.def", "x" : 456, "y" : 109, "z" : -5, "border" : "TOCSHOLY.bmp", "area" : "TZCSHOLY.bmp" },
+				"dwellingLvl1":   { "animation" : "TBCSDW_0.def", "x" : 304, "y" : 92,  "z" : -1, "border" : "TOCSPIK1.bmp", "area" : "TZCSPIK1.bmp" },
 				"dwellingLvl2":   { "animation" : "TBCSDW_1.def", "x" : 360, "y" : 130, "border" : "TOCSCRS1.bmp", "area" : "TZCSCRS1.bmp" },
 				"dwellingLvl3":   { "animation" : "TBCSDW_2.def", "x" : 76,  "y" : 57,  "z" : -1, "border" : "TOCSGR1N.bmp", "area" : "TZCSGR1N.bmp" },
 				"dwellingLvl4":   { "animation" : "TBCSDW_3.def", "x" : 176, "y" : 101, "border" : "TOCSSWD1.bmp", "area" : "TZCSSWD1.bmp" },
 				"dwellingLvl5":   { "animation" : "TBCSDW_4.def", "x" : 563, "y" : 211, "z" : 1,  "border" : "TOCSMON1.bmp", "area" : "TZCSMON1.bmp" },
 				"dwellingLvl6":   { "animation" : "TBCSDW_5.def", "x" : 174, "y" : 190, "z" : -1, "border" : "TOCSC101.bmp", "area" : "TZCSCAV1.bmp" },
 				"dwellingLvl7":   { "animation" : "TBCSDW_6.def", "x" : 303, "y" : 0,   "z" : -1, "border" : "TOCSANG1.bmp", "area" : "TZCSANG1.bmp" },
-				"dwellingUpLvl1": { "animation" : "TBCSUP_0.def", "x" : 304, "y" : 65,  "border" : "TOCSPIK2.bmp", "area" : "TZCSPIK2.bmp" },
+				"dwellingUpLvl1": { "animation" : "TBCSUP_0.def", "x" : 304, "y" : 65,  "z" : -1, "border" : "TOCSPIK2.bmp", "area" : "TZCSPIK2.bmp" },
 				"dwellingUpLvl2": { "animation" : "TBCSUP_1.def", "x" : 360, "y" : 115, "border" : "TOCSCRS2.bmp", "area" : "TZCSCRS2.bmp" },
 				"dwellingUpLvl3": { "animation" : "TBCSUP_2.def", "x" : 76,  "y" : 35,  "z" : -1, "border" : "TOCSGR2N.bmp", "area" : "TZCSGR2N.bmp" },
 				"dwellingUpLvl4": { "animation" : "TBCSUP_3.def", "x" : 176, "y" : 85,  "border" : "TOCSSWD2.bmp", "area" : "TZCSSWD2.bmp" },

+ 8 - 8
config/factions/conflux.json

@@ -78,14 +78,14 @@
 			},
 			"structures" :
 			{
-				"extraAnimation2":{ "animation" : "TBELEXT5.def", "x" : 682, "y" : 183,  "z" : -1 },
+				"extraAnimation2":{ "animation" : "TBELEXT5.def", "x" : 682, "y" : 183, "z" : -1 },
 				"extraAnimation": { "animation" : "TBELEXT1.def", "x" : 23,  "y" : 218 },
 				"mageGuild1":     { "animation" : "TBELMAGE.def", "x" : 206, "y" : 58,  "z" : 4,  "border" : "TOELMAGE.bmp", "area" : "TZELMAGE.bmp" },
 				"mageGuild2":     { "animation" : "TBELMAG2.def", "x" : 206, "y" : 58,  "z" : 4,  "border" : "TOELMAG2.bmp", "area" : "TZELMAG2.bmp" },
 				"mageGuild3":     { "animation" : "TBELMAG3.def", "x" : 206, "y" : 58,  "z" : 4,  "border" : "TOELMAG3.bmp", "area" : "TZELMAG3.bmp" },
 				"mageGuild4":     { "animation" : "TBELMAG4.def", "x" : 206, "y" : 58,  "z" : 4,  "border" : "TOELMAG4.bmp", "area" : "TZELMAG4.bmp" },
 				"mageGuild5":     { "animation" : "TBELMAG5.def", "x" : 206, "y" : 58,  "z" : 4,  "border" : "TOELMAG5.bmp", "area" : "TZELMAG5.bmp" },
-				"tavern":         { "animation" : "TBELTVRN.def", "x" : 553, "y" : 203, "z" : 1,  "border" : "TOELTVRN.bmp", "area" : "TZELTVRN.bmp" },
+				"tavern":         { "animation" : "TBELTVRN.def", "x" : 553, "y" : 203, "z" : 2,  "border" : "TOELTVRN.bmp", "area" : "TZELTVRN.bmp" },
 				"shipyard":       { "animation" : "TBELDOCK.def", "x" : 239, "y" : 215, "z" : 2,  "border" : "TOELDOCK.bmp", "area" : "TZELDOCK.bmp" },
 				"fort":           { "animation" : "TBELCSTL.def", "x" : 349, "y" : 101, "z" : -1, "border" : "TOELCSTL.bmp", "area" : "TZELCSTL.bmp" },
 				"citadel":        { "animation" : "TBELCAS2.def", "x" : 349, "y" : 101, "z" : -1, "border" : "TOELCAS2.bmp", "area" : "TZELCAS2.bmp" },
@@ -103,22 +103,22 @@
 				"ship":           { "animation" : "TBELBOAT.def", "x" : 239, "y" : 215, "z" : 2,  "border" : "TOELBOAT.bmp", "area" : "TZELBOAT.bmp", "hidden" : true },
 				"special2":       { "animation" : "TBELEXT6.def", "x" : 104, "y" : 170, "z" : 3,  "border" : "TOELEXT6.bmp", "area" : "TZELEXT6.bmp" },
 				"grail":          { "animation" : "TBELHOLY.def", "x" : 307, "y" : 2,   "border" : "TOELHOLY.bmp", "area" : "TZELHOLY.bmp" },
-				"extraTownHall":  { "animation" : "TBELEXT2.def", "x" : 232, "y" : 205 },
-				"extraCityHall":  { "animation" : "TBELEXT3.def", "x" : 516, "y" : 223, "z" : 1 },
+				"extraTownHall":  { "animation" : "TBELEXT2.def", "x" : 232, "y" : 205, "z" : -1 },
+				"extraCityHall":  { "animation" : "TBELEXT3.def", "x" : 516, "y" : 223 },
 				"extraCapitol":   { "animation" : "TBELEXT4.def", "x" : 0,   "y" : 252, "z" : 6 },
 				"dwellingLvl1":   { "animation" : "TBELDW_0.def", "x" : 689, "y" : 250, "border" : "TOELDW_0.bmp", "area" : "TZELDW_0.bmp" },
-				"dwellingLvl2":   { "animation" : "TBELDW_1.def", "x" : 630, "y" : 50,  "border" : "TOELDW_1.bmp", "area" : "TZELDW_1.bmp" },
+				"dwellingLvl2":   { "animation" : "TBELDW_1.def", "x" : 630, "y" : 50,  "z" : -1, "border" : "TOELDW_1.bmp", "area" : "TZELDW_1.bmp" },
 				"dwellingLvl3":   { "animation" : "TBELDW_2.def", "x" : 709, "y" : 210, "z" : -1, "border" : "TOELDW_2.bmp", "area" : "TZELDW_2.bmp" },
 				"dwellingLvl4":   { "animation" : "TBELDW_3.def", "x" : 108, "y" : 131, "z" : -1, "border" : "TOELDW_3.bmp", "area" : "TZELDW_3.bmp" },
 				"dwellingLvl5":   { "animation" : "TBELDW_4.def", "x" : 264, "y" : 168, "z" : -1, "border" : "TOELDW_4.bmp", "area" : "TZELDW_4.bmp" },
-				"dwellingLvl6":   { "animation" : "TBELDW_5.def", "x" : 394, "y" : 283, "z" : 2,  "border" : "TOELDW_5.bmp", "area" : "TZELDW_5.bmp" },
+				"dwellingLvl6":   { "animation" : "TBELDW_5.def", "x" : 394, "y" : 283, "z" :  4, "border" : "TOELDW_5.bmp", "area" : "TZELDW_5.bmp" },
 				"dwellingLvl7":   { "animation" : "TBELDW_6.def", "x" : 43,  "y" : 16,  "z" : -2, "border" : "TOELDW_6.bmp", "area" : "TZELDW_6.bmp" },
 				"dwellingUpLvl1": { "animation" : "TBELUP_0.def", "x" : 689, "y" : 250, "border" : "TOELUP_0.bmp", "area" : "TZELUP_0.bmp" },
-				"dwellingUpLvl2": { "animation" : "TBELUP_1.def", "x" : 630, "y" : 50,  "border" : "TOELUP_1.bmp", "area" : "TZELUP_1.bmp" },
+				"dwellingUpLvl2": { "animation" : "TBELUP_1.def", "x" : 630, "y" : 50,  "z" : -1, "border" : "TOELUP_1.bmp", "area" : "TZELUP_1.bmp" },
 				"dwellingUpLvl3": { "animation" : "TBELUP_2.def", "x" : 709, "y" : 210, "z" : -1, "border" : "TOELUP_2.bmp", "area" : "TZELUP_2.bmp" },
 				"dwellingUpLvl4": { "animation" : "TBELUP_3.def", "x" : 108, "y" : 131, "z" : -1, "border" : "TOELUP_3.bmp", "area" : "TZELUP_3.bmp" },
 				"dwellingUpLvl5": { "animation" : "TBELUP_4.def", "x" : 264, "y" : 168, "z" : -1, "border" : "TOELUP_4.bmp", "area" : "TZELUP_4.bmp" },
-				"dwellingUpLvl6": { "animation" : "TBELUP_5.def", "x" : 394, "y" : 283, "z" : 2,  "border" : "TOELUP_5.bmp", "area" : "TZELUP_5.bmp" },
+				"dwellingUpLvl6": { "animation" : "TBELUP_5.def", "x" : 394, "y" : 283, "z" :  4,  "border" : "TOELUP_5.bmp", "area" : "TZELUP_5.bmp" },
 				"dwellingUpLvl7": { "animation" : "TBELUP_6.def", "x" : 43,  "y" : 0,   "z" : -2, "border" : "TOELUP_6.bmp", "area" : "TZELUP_6.bmp" }
 			},
 

+ 1 - 1
config/factions/inferno.json

@@ -98,7 +98,7 @@
 				"horde1":         { "animation" : "TBINHRD1.def", "x" : 614, "y" : 256, "border" : "TOIMP1HA.bmp", "area" : "TZIMP1HA.bmp", "hidden" : true },
 				"horde1Upgr":     { "animation" : "TBINHRD2.def", "x" : 614, "y" : 221, "border" : "TOIMP2HA.bmp", "area" : "TZIMP2HA.bmp", "hidden" : true, "builds" : "horde1" },
 				"special2":       { "animation" : "TBINEXT0.def", "x" : 297, "y" : 0,   "z" : -1, "border" : "TOICAB1A.bmp", "area" : "TZICAB1A.bmp" },
-				"special3":       { "animation" : "TBINEXT1.def", "x" : 227, "y" : 174, "z" : 2,  "border" : "TOICASGA.bmp", "area" : "TZICASGA.bmp" },
+				"special3":       { "animation" : "TBINEXT1.def", "x" : 227, "y" : 174, "z" : -1,  "border" : "TOICASGA.bmp", "area" : "TZICASGA.bmp" },
 				"special4":       { "animation" : "TBINEXT2.def", "x" : 593, "y" : 104, "border" : "TOIPAIN.bmp",  "area" : "TZIPAIN.bmp"  },
 				"horde2":         { "animation" : "TBINHRD3.def", "x" : 10,  "y" : 301, "border" : "TOIHND1H.bmp", "area" : "TZIHND1H.bmp", "hidden" : true },
 				"horde2Upgr":     { "animation" : "TBINHRD4.def", "x" : 9,   "y" : 273, "border" : "TOIHND2H.bmp", "area" : "TZIHND2H.bmp", "hidden" : true, "builds" : "horde2" },

+ 9 - 9
config/factions/necropolis.json

@@ -79,7 +79,7 @@
 			},
 			"structures" :
 			{
-				"extraAnimation": { "animation" : "TBNCEXT2.def", "x" : 25,  "y" : 279 },
+				"extraAnimation": { "animation" : "TBNCEXT2.def", "x" : 25,  "y" : 279, "z" : 8 },
 				"mageGuild1":     { "animation" : "TBNCMAGE.def", "x" : 341, "y" : 116, "z" : -1, "border" : "TONMAG1.bmp",  "area" : "TZNMAG1.bmp" },
 				"mageGuild2":     { "animation" : "TBNCMAG2.def", "x" : 341, "y" : 97,  "z" : -1, "border" : "TONMAG2.bmp",  "area" : "TZNMAG2.bmp" },
 				"mageGuild3":     { "animation" : "TBNCMAG3.def", "x" : 341, "y" : 78,  "z" : -1, "border" : "TONMAG3.bmp",  "area" : "TZNMAG3.bmp" },
@@ -96,7 +96,7 @@
 				"capitol":        { "animation" : "TBNCHAL4.def", "x" : 481, "y" : 26,  "z" : -1, "border" : "TONHAL4.bmp",  "area" : "TZNHAL4.bmp" },
 				"marketplace":    { "animation" : "TBNCMARK.def", "x" : 347, "y" : 215, "z" : 2,  "border" : "TONMRK1.bmp",  "area" : "TZNMRK1.bmp" },
 				"resourceSilo":   { "animation" : "TBNCSILO.def", "x" : 276, "y" : 185, "z" : 1,  "border" : "TONMRK2.bmp",  "area" : "TZNMRK2.bmp" },
-				"blacksmith":     { "animation" : "TBNCBLAK.def", "x" : 382, "y" : 252, "z" : 4,  "border" : "TONSMITA.bmp", "area" : "TZNSMITA.bmp" },
+				"blacksmith":     { "animation" : "TBNCBLAK.def", "x" : 382, "y" : 252, "z" : 6,  "border" : "TONSMITA.bmp", "area" : "TZNSMITA.bmp" },
 				"special1":       { "animation" : "TBNCSPEC.def", "x" : 18,  "y" : 0,   "z" : -1, "border" : "TONSHRDA.bmp", "area" : "TZNSHRDA.bmp" },
 				"horde1":         { "animation" : "TBNCHRD1.def", "x" : 80,  "y" : 222, "z" : 4, "border" : "TONSKE1H.bmp", "area" : "TZNSKE1H.bmp", "hidden" : true },
 				"horde1Upgr":     { "animation" : "TBNCHRD2.def", "x" : 64,  "y" : 222, "z" : 4, "border" : "TONSKE2H.bmp", "area" : "TZNSKE2H.bmp", "hidden" : true, "builds" : "horde1" },
@@ -104,19 +104,19 @@
 				"special2":       { "animation" : "TBNCEXT0.def", "x" : 307, "y" : 61,  "z" : -2, "border" : "TONNECRA.bmp", "area" : "TZNNECRA.bmp" },
 				"special3":       { "animation" : "TBNCEXT1.def", "x" : 247, "y" : 275, "z" : 4,  "border" : "TONSKELT.bmp", "area" : "TZNSKELT.bmp" },
 				"grail":          { "animation" : "TBNCHOLY.def", "x" : 410, "y" : 88,  "border" : "TONHOLYA.bmp", "area" : "TZNHOLYA.bmp" },
-				"extraTownHall":  { "animation" : "TBNCEXT3.def", "x" : 0,   "y" : 241 },
-				"extraCityHall":  { "animation" : "TBNCEXT4.def", "x" : 321, "y" : 255 },
-				"extraCapitol":   { "animation" : "TBNCEXT5.def", "x" : 475, "y" : 257 },
+				"extraTownHall":  { "animation" : "TBNCEXT3.def", "x" : 0,   "y" : 241, "z" : 5 },
+				"extraCityHall":  { "animation" : "TBNCEXT4.def", "x" : 321, "y" : 255, "z" : 5 },
+				"extraCapitol":   { "animation" : "TBNCEXT5.def", "x" : 475, "y" : 257, "z" : 5 },
 				"dwellingLvl1":   { "animation" : "TBNCDW_0.def", "x" : 80,  "y" : 222, "z" : 4, "border" : "TONSKEL1.bmp", "area" : "TZNSKEL1.bmp" },
-				"dwellingLvl2":   { "animation" : "TBNCDW_1.def", "x" : 502, "y" : 223, "border" : "TONZOMB1.bmp", "area" : "TZNZOMB1.bmp" },
-				"dwellingLvl3":   { "animation" : "TBNCDW_2.def", "x" : 0,   "y" : 187, "z" : 2, "border" : "TONWIGH1.bmp", "area" : "TZNWIGH1.bmp" },
+				"dwellingLvl2":   { "animation" : "TBNCDW_1.def", "x" : 502, "y" : 223, "z" : 1, "border" : "TONZOMB1.bmp", "area" : "TZNZOMB1.bmp" },
+				"dwellingLvl3":   { "animation" : "TBNCDW_2.def", "x" : 0,   "y" : 187, "z" : 7, "border" : "TONWIGH1.bmp", "area" : "TZNWIGH1.bmp" },
 				"dwellingLvl4":   { "animation" : "TBNCDW_3.def", "x" : 607, "y" : 212, "z" : 2, "border" : "TONVAM1.bmp",  "area" : "TZNVAM1.bmp" },
 				"dwellingLvl5":   { "animation" : "TBNCDW_4.def", "x" : 206, "y" : 207, "z" : 3, "border" : "TONLICH1.bmp", "area" : "TZNLICH1.bmp" },
 				"dwellingLvl6":   { "animation" : "TBNCDW_5.def", "x" : 0,   "y" : 31,  "border" : "TONBKN1.bmp",  "area" : "TZNBKN1.bmp" },
 				"dwellingLvl7":   { "animation" : "TBNCDW_6.def", "x" : 663, "y" : 25,  "border" : "TONBON1.bmp",  "area" : "TZNBON1.bmp" },
 				"dwellingUpLvl1": { "animation" : "TBNCUP_0.def", "x" : 64,  "y" : 222, "z" : 4, "border" : "TONSKEL2.bmp", "area" : "TZNSKEL2.bmp" },
-				"dwellingUpLvl2": { "animation" : "TBNCUP_1.def", "x" : 498, "y" : 224, "border" : "TONZOMB2.bmp", "area" : "TZNZOMB2.bmp" },
-				"dwellingUpLvl3": { "animation" : "TBNCUP_2.def", "x" : 0,   "y" : 179, "z" : 2, "border" : "TONWIGH2.bmp", "area" : "TZNWIGH2.bmp" },
+				"dwellingUpLvl2": { "animation" : "TBNCUP_1.def", "x" : 498, "y" : 224, "z" : 1, "border" : "TONZOMB2.bmp", "area" : "TZNZOMB2.bmp" },
+				"dwellingUpLvl3": { "animation" : "TBNCUP_2.def", "x" : 0,   "y" : 179, "z" : 7, "border" : "TONWIGH2.bmp", "area" : "TZNWIGH2.bmp" },
 				"dwellingUpLvl4": { "animation" : "TBNCUP_3.def", "x" : 615, "y" : 193, "z" : 2, "border" : "TONVAM2.bmp",  "area" : "TZNVAM2.bmp" },
 				"dwellingUpLvl5": { "animation" : "TBNCUP_4.def", "x" : 222, "y" : 171, "z" : 3, "border" : "TONLICH2.bmp", "area" : "TZNLICH2.bmp" },
 				"dwellingUpLvl6": { "animation" : "TBNCUP_5.def", "x" : 0,   "y" : 30,  "border" : "TONBKN2.bmp",  "area" : "TZNBKN2.bmp" },

+ 5 - 5
config/factions/rampart.json

@@ -78,7 +78,7 @@
 			},
 			"structures" :
 			{
-				"extraAnimation": { "animation" : "TBRMEXT2.def", "x" : 327, "y" : 236 },
+				"extraAnimation": { "animation" : "TBRMEXT2.def", "x" : 327, "y" : 236, "z" : 1 },
 				"mageGuild1":     { "animation" : "TBRMMAGE.def", "x" : 454, "y" : 200, "z" : -1, "border" : "TORMAG1.bmp",  "area" : "TZRMAG1.bmp" },
 				"mageGuild2":     { "animation" : "TBRMMAG2.def", "x" : 438, "y" : 178, "z" : -1, "border" : "TORMAG2.bmp",  "area" : "TZRMAG2.bmp" },
 				"mageGuild3":     { "animation" : "TBRMMAG3.def", "x" : 418, "y" : 153, "z" : -1, "border" : "TORMAG3.bmp",  "area" : "TZRMAG3.bmp" },
@@ -95,7 +95,7 @@
 				"marketplace":    { "animation" : "TBRMMARK.def", "x" : 129, "y" : 301, "z" : 3,  "border" : "TORMRK1.bmp",  "area" : "TZRMRK1.bmp" },
 				"resourceSilo":   { "animation" : "TBRMSILO.def", "x" : 245, "y" : 324, "z" : 4,  "border" : "TORMRK2.bmp",  "area" : "TZRMRK2.bmp" },
 				"blacksmith":     { "animation" : "TBRMBLAK.def", "x" : 558, "y" : 105, "z" : -3, "border" : "TORAID.bmp",   "area" : "TZRAID.bmp" },
-				"special1":       { "animation" : "TBRMSPEC.def", "x" : 555, "y" : 297, "border" : "TORGAR1A.bmp", "area" : "TZRGAR1A.bmp" },
+				"special1":       { "animation" : "TBRMSPEC.def", "x" : 555, "y" : 297, "z" : 2, "border" : "TORGAR1A.bmp", "area" : "TZRGAR1A.bmp" },
 				"horde1":         { "animation" : "TBRMHRD1.def", "x" : 0,   "y" : 154, "border" : "TORDWF1H.bmp", "area" : "TZRDWF1H.bmp", "hidden" : true },
 				"horde1Upgr":     { "animation" : "TBRMHRD2.def", "x" : 0,   "y" : 143, "border" : "TORDWF2H.bmp", "area" : "TZRDWF2H.bmp", "hidden" : true, "builds" : "horde1" },
 				"special2":       { "animation" : "TBRMEXT0.def", "x" : 555, "y" : 297, "z" : 2, "border" : "TORGAR2A.bmp", "area" : "TZRGAR2A.bmp" },
@@ -103,9 +103,9 @@
 				"horde2":         { "animation" : "TBRMHRD3.def", "x" : 47,  "y" : 142, "z" : -1, "border" : "TORTRE1H.bmp", "area" : "TZRTRE1H.bmp", "hidden" : true },
 				"horde2Upgr":     { "animation" : "TBRMHRD4.def", "x" : 47,  "y" : 142, "z" : -1, "border" : "TORTRE2H.bmp", "area" : "TZRTRE2H.bmp", "hidden" : true, "builds" : "horde2" },
 				"grail":          { "animation" : "TBRMHOLY.def", "x" : 0,   "y" : 54,  "z" : -1, "border" : "TORHOLY.bmp",  "area" : "TZRHOLY.bmp" },
-				"extraTownHall":  { "animation" : "TBRMEXT3.def", "x" : 293, "y" : 235 },
-				"extraCityHall":  { "animation" : "TBRMEXT4.def", "x" : 295, "y" : 191 },
-				"extraCapitol":   { "animation" : "TBRMEXT5.def", "x" : 260, "y" : 171 },
+				"extraTownHall":  { "animation" : "TBRMEXT3.def", "x" : 293, "y" : 235, "z" : 2 },
+				"extraCityHall":  { "animation" : "TBRMEXT4.def", "x" : 295, "y" : 191, "z" : 0 },
+				"extraCapitol":   { "animation" : "TBRMEXT5.def", "x" : 260, "y" : 171, "z" : 3 },
 				"dwellingLvl1":   { "animation" : "TBRMDW_0.def", "x" : 0,   "y" : 236, "z" : 2,  "border" : "TORCEN1A.bmp", "area" : "TZRCEN1A.bmp" },
 				"dwellingLvl2":   { "animation" : "TBRMDW_1.def", "x" : 0,   "y" : 154, "border" : "TORDWF1.bmp",  "area" : "TZRDWF1.bmp" },
 				"dwellingLvl3":   { "animation" : "TBRMDW_2.def", "x" : 668, "y" : 101, "border" : "TORELF1.bmp",  "area" : "TZRELF1.bmp" },

+ 1 - 1
config/factions/stronghold.json

@@ -91,7 +91,7 @@
 				"cityHall":       { "animation" : "TBSTHAL3.def", "x" : 0,   "y" : 201, "border" : "TOSHAL3A.bmp", "area" : "TZSHAL3A.bmp" },
 				"capitol":        { "animation" : "TBSTHAL4.def", "x" : 0,   "y" : 148, "border" : "TOSHAL4A.bmp", "area" : "TZSHAL4A.bmp" },
 				"marketplace":    { "animation" : "TBSTMARK.def", "x" : 397, "y" : 308, "z" : 1,  "border" : "TOSMRK1.bmp",  "area" : "TZSMRK1.bmp" },
-				"resourceSilo":   { "animation" : "TBSTSILO.def", "x" : 458, "y" : 248, "z" : 1,  "border" : "TOSMRK2.bmp",  "area" : "TZSMRK2.bmp" },
+				"resourceSilo":   { "animation" : "TBSTSILO.def", "x" : 458, "y" : 248, "z" : 2,  "border" : "TOSMRK2.bmp",  "area" : "TZSMRK2.bmp" },
 				"blacksmith":     { "animation" : "TBSTBLAK.def", "x" : 660, "y" : 286, "border" : "TOSBLK1.bmp",  "area" : "TZSBLK1.bmp" },
 				"special1":       { "animation" : "TBSTSPEC.def", "x" : 550, "y" : 229, "border" : "TOSCA1EA.bmp", "area" : "TZSCA1EA.bmp" },
 				"horde1":         { "animation" : "TBSTHRD1.def", "x" : 373, "y" : 239, "border" : "TOSGOB1H.bmp", "area" : "TZSGOB1H.bmp", "hidden" : true },

+ 1 - 0
config/schemas/battlefield.json

@@ -18,6 +18,7 @@
 		},
 		"graphics": {
 			"type":"string",
+			"format" : "imageFile",
 			"description": "BMP battleground resource"
 		},
 		"isSpecial": {

+ 6 - 3
config/schemas/objectType.json

@@ -22,21 +22,24 @@
 					"type":"array",
 					"description": "Background sound of an object",
 					"items": {
-						"type": "string"
+						"type": "string",
+						"format" : "soundFile"
 					}
 				},
 				"visit": {
 					"type":"array",
 					"description": "Sound that played on object visit",
 					"items": {
-						"type": "string"
+						"type": "string",
+						"format" : "soundFile"
 					}
 				},
 				"removal": {
 					"type":"array",
 					"description": "Sound that played on object removal",
 					"items": {
-						"type": "string"
+						"type": "string",
+						"format" : "soundFile"
 					}
 				}
 			}

+ 8 - 4
config/schemas/terrain.json

@@ -47,7 +47,8 @@
 		"music":
 		{
 			"type": "string",
-			"description": "Music filename to play on this terrain on adventure map"
+			"description": "Music filename to play on this terrain on adventure map",
+			"format": "musicFile"
 		},
 		"tiles":
 		{
@@ -78,12 +79,14 @@
 		"horseSound":
 		{
 			"type": "string",
-			"description": "Hero movement sound for this terrain, version for moving on tiles with road"
+			"description": "Hero movement sound for this terrain, version for moving on tiles with road",
+			"format": "soundFile"
 		},
 		"horseSoundPenalty":
 		{
 			"type": "string",
-			"description": "Hero movement sound for this terrain, version for moving on tiles without road"
+			"description": "Hero movement sound for this terrain, version for moving on tiles without road",
+			"format": "soundFile"
 		},
 		"shortIdentifier":
 		{
@@ -112,7 +115,8 @@
 					"description": "list of ambient sounds for this terrain",
 					"items":
 					{
-						"type": "string"
+						"type": "string",
+						"format": "soundFile"
 					}
 				}
 			}

+ 3 - 0
lib/CModHandler.cpp

@@ -422,6 +422,9 @@ bool ContentTypeHandler::loadMod(const std::string & modName, bool validate)
 		const std::string & name = entry.first;
 		JsonNode & data = entry.second;
 
+		if (data.meta != modName)
+			logMod->warn("Mod %s is attempting to inject object %s into mod %s! This may not be supported in future versions!", data.meta, name, modName);
+
 		if (vstd::contains(data.Struct(), "index") && !data["index"].isNull())
 		{
 			if (modName != "core")

+ 6 - 0
lib/CTownHandler.cpp

@@ -19,6 +19,7 @@
 #include "CHeroHandler.h"
 #include "CArtHandler.h"
 #include "GameSettings.h"
+#include "TerrainHandler.h"
 #include "spells/CSpellHandler.h"
 #include "filesystem/Filesystem.h"
 #include "mapObjects/CObjectClassesHandler.h"
@@ -1035,6 +1036,11 @@ CFaction * CTownHandler::loadFromJson(const std::string & scope, const JsonNode
 	{
 		VLC->modh->identifiers.requestIdentifier("terrain", source["nativeTerrain"], [=](int32_t index){
 			faction->nativeTerrain = TerrainId(index);
+
+			auto const & terrain = VLC->terrainTypeHandler->getById(faction->nativeTerrain);
+
+			if (!terrain->isSurface() && !terrain->isUnderground())
+				logMod->warn("Faction %s has terrain %s as native, but terrain is not suitable for either surface or subterranean layers!", faction->getJsonKey(), terrain->getJsonKey());
 		});
 	}
 

+ 2 - 1
lib/JsonDetail.cpp

@@ -1047,7 +1047,8 @@ namespace
 
 		std::string musicFile(const JsonNode & node)
 		{
-			TEST_FILE(node.meta, "", node.String(), EResType::MUSIC);
+			TEST_FILE(node.meta, "Music/", node.String(), EResType::SOUND);
+			TEST_FILE(node.meta, "", node.String(), EResType::SOUND);
 			return "Music file \"" + node.String() + "\" was not found";
 		}
 

+ 3 - 4
lib/filesystem/ResourceID.cpp

@@ -139,14 +139,14 @@ EResType::Type EResTypeHelper::getTypeFromExtension(std::string extension)
 		{".TGA",   EResType::IMAGE},
 		{".WAV",   EResType::SOUND},
 		{".82M",   EResType::SOUND},
+		{".MP3",   EResType::SOUND},
+		{".OGG",   EResType::SOUND},
+		{".FLAC",  EResType::SOUND},
 		{".SMK",   EResType::VIDEO},
 		{".BIK",   EResType::VIDEO},
 		{".MJPG",  EResType::VIDEO},
 		{".MPG",   EResType::VIDEO},
 		{".AVI",   EResType::VIDEO},
-		{".MP3",   EResType::MUSIC},
-		{".OGG",   EResType::MUSIC},
-		{".FLAC",  EResType::MUSIC},
 		{".ZIP",   EResType::ARCHIVE_ZIP},
 		{".LOD",   EResType::ARCHIVE_LOD},
 		{".PAC",   EResType::ARCHIVE_LOD},
@@ -186,7 +186,6 @@ std::string EResTypeHelper::getEResTypeAsString(EResType::Type type)
 		MAP_ENUM(IMAGE)
 		MAP_ENUM(VIDEO)
 		MAP_ENUM(SOUND)
-		MAP_ENUM(MUSIC)
 		MAP_ENUM(ARCHIVE_ZIP)
 		MAP_ENUM(ARCHIVE_LOD)
 		MAP_ENUM(ARCHIVE_SND)

+ 0 - 1
lib/filesystem/ResourceID.h

@@ -45,7 +45,6 @@ namespace EResType
 		IMAGE,
 		VIDEO,
 		SOUND,
-		MUSIC,
 		ARCHIVE_VID,
 		ARCHIVE_ZIP,
 		ARCHIVE_SND,