Browse Source

Fixed few more cases of incorrect town building ordering

Ivan Savenko 9 months ago
parent
commit
5d67de0e46

+ 5 - 0
client/renderSDL/RenderHandler.cpp

@@ -379,7 +379,12 @@ static void detectOverlappingBuildings(RenderHandler * renderHandler, const Fact
 				continue; // only a<->b comparison is needed, not a<->a or b<->a
 
 			if (left->building && right->building && left->building->getBase() == right->building->getBase())
+			{
+				if (left->pos.z != right->pos.z)
+					logMod->warn("Town %s: Upgrades of same building have different z-index: '%s' and '%s'", faction->getJsonKey(), left->identifier, right->identifier);
+
 				continue; // upgrades of the same buildings are expected to overlap
+			}
 
 			if (left->pos.z != right->pos.z)
 				continue; // buildings already have different z-index and have well-defined overlap logic

+ 1 - 1
config/factions/dungeon.json

@@ -92,7 +92,7 @@
 				"villageHall":    { "animation" : "TBDNHALL.def", "x" : 0,   "y" : 234, "border" : "TODHALL1.bmp", "area" : "TZDHALL1.bmp" },
 				"townHall":       { "animation" : "TBDNHAL2.def", "x" : 0,   "y" : 223, "border" : "TODHALL2.bmp", "area" : "TZDHALL2.bmp" },
 				"cityHall":       { "animation" : "TBDNHAL3.def", "x" : 0,   "y" : 223, "border" : "TODHALL3.bmp", "area" : "TZDHALL3.bmp" },
-				"capitol":        { "animation" : "TBDNHAL4.def", "x" : 0,   "y" : 203, "z" : -1, "border" : "TODHALL4.bmp", "area" : "TZDHALL4.bmp" },
+				"capitol":        { "animation" : "TBDNHAL4.def", "x" : 0,   "y" : 203, "border" : "TODHALL4.bmp", "area" : "TZDHALL4.bmp" },
 				"marketplace":    { "animation" : "TBDNMARK.def", "x" : 590, "y" : 318, "z" : -2, "border" : "TODMARK.bmp",  "area" : "TZDMARK.bmp" },
 				"resourceSilo":   { "animation" : "TBDNSILO.def", "x" : 624, "y" : 335, "z" : 1,  "border" : "TODSILO.bmp",  "area" : "TZDSILO.bmp" },
 				"blacksmith":     { "animation" : "TBDNBLAK.def", "x" : 544, "y" : 248, "z" : -3, "border" : "TODSMITH.bmp", "area" : "TZDSMITH.bmp" },

+ 1 - 1
config/factions/fortress.json

@@ -84,7 +84,7 @@
 				"mageGuild2":     { "animation" : "TBFRMAG2.def", "x" : 0,   "y" : 177, "z" : -1, "border" : "TOFMAG2A.bmp", "area" : "TZFMAG2A.bmp" },
 				"mageGuild3":     { "animation" : "TBFRMAG3.def", "x" : 0,   "y" : 135, "z" : -1, "border" : "TOFMAG3A.bmp", "area" : "TZFMAG3A.bmp" },
 				"tavern":         { "animation" : "TBFRTVRN.def", "x" : 634, "y" : 219, "z" : 3,  "border" : "TOFTAVA.bmp",  "area" : "TZFTAVA.bmp" },
-				"shipyard":       { "animation" : "TBFRDOCK.def", "x" : 197, "y" : 294, "border" : "TOFDCK2.bmp",  "area" : "TZFDCK2.bmp" },
+				"shipyard":       { "animation" : "TBFRDOCK.def", "x" : 197, "y" : 294, "z" : 1,  "border" : "TOFDCK2.bmp",  "area" : "TZFDCK2.bmp" },
 				"fort":           { "animation" : "TBFRCSTL.def", "x" : 368, "y" : 118, "z" : -2, "border" : "TOFCAS1.bmp",  "area" : "TZFCAS1.bmp" },
 				"citadel":        { "animation" : "TBFRCAS2.def", "x" : 368, "y" : 98,  "z" : -2, "border" : "TOFCAS2.bmp",  "area" : "TZFCAS2.bmp" },
 				"castle":         { "animation" : "TBFRCAS3.def", "x" : 368, "y" : 55,  "z" : -2, "border" : "TOFCAS3.bmp",  "area" : "TZFCAS3.bmp" },

+ 4 - 4
config/factions/rampart.json

@@ -97,8 +97,8 @@
 				"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, "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" },
+				"horde1":         { "animation" : "TBRMHRD1.def", "x" : 0,   "y" : 154, "z" : -2, "border" : "TORDWF1H.bmp", "area" : "TZRDWF1H.bmp", "hidden" : true },
+				"horde1Upgr":     { "animation" : "TBRMHRD2.def", "x" : 0,   "y" : 143, "z" : -2, "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" },
 				"special3":       { "animation" : "TBRMEXT1.def", "x" : 0,   "y" : 181, "z" : 1, "border" : "TORDWFT.bmp",  "area" : "TZRDWFT.bmp" },
 				"horde2":         { "animation" : "TBRMHRD3.def", "x" : 47,  "y" : 142, "z" : -1, "border" : "TORTRE1H.bmp", "area" : "TZRTRE1H.bmp", "hidden" : true },
@@ -108,14 +108,14 @@
 				"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" },
+				"dwellingLvl2":   { "animation" : "TBRMDW_1.def", "x" : 0,   "y" : 154, "z" : -2, "border" : "TORDWF1.bmp",  "area" : "TZRDWF1.bmp" },
 				"dwellingLvl3":   { "animation" : "TBRMDW_2.def", "x" : 668, "y" : 101, "z" : -1, "border" : "TORELF1.bmp",  "area" : "TZRELF1.bmp" },
 				"dwellingLvl4":   { "animation" : "TBRMDW_3.def", "x" : 287, "y" : 73,  "z" : -1, "border" : "TORPEG1A.bmp", "area" : "TZRPEG1A.bmp" },
 				"dwellingLvl5":   { "animation" : "TBRMDW_4.def", "x" : 68,  "y" : 146, "z" : -1, "border" : "TORTRE1.bmp",  "area" : "TZRTRE1.bmp" },
 				"dwellingLvl6":   { "animation" : "TBRMDW_5.def", "x" : 362, "y" : 90,  "z" : -2, "border" : "TORUNI1.bmp",  "area" : "TZRUNI1.bmp" },
 				"dwellingLvl7":   { "animation" : "TBRMDW_6.def", "x" : 502, "y" : 27,  "z" : -5, "border" : "TORDR1AA.bmp", "area" : "TZRDR1AA.bmp" },
 				"dwellingUpLvl1": { "animation" : "TBRMUP_0.def", "x" : 0,   "y" : 236, "z" : 2,  "border" : "TORCEN2A.bmp", "area" : "TZRCEN2A.bmp" },
-				"dwellingUpLvl2": { "animation" : "TBRMUP_1.def", "x" : 0,   "y" : 143, "border" : "TORDWF2.bmp",  "area" : "TZRDWF2.bmp" },
+				"dwellingUpLvl2": { "animation" : "TBRMUP_1.def", "x" : 0,   "y" : 143, "z" : -2, "border" : "TORDWF2.bmp",  "area" : "TZRDWF2.bmp" },
 				"dwellingUpLvl3": { "animation" : "TBRMUP_2.def", "x" : 665, "y" : 101, "z" : -1, "border" : "TORELF2.bmp",  "area" : "TZRELF2.bmp" },
 				"dwellingUpLvl4": { "animation" : "TBRMUP_3.def", "x" : 287, "y" : 28,  "z" : -1, "border" : "TORPEG2A.bmp", "area" : "TZRPEG2A.bmp" },
 				"dwellingUpLvl5": { "animation" : "TBRMUP_4.def", "x" : 63,  "y" : 146, "z" : -1, "border" : "TORTRE2.bmp",  "area" : "TZRTRE2.bmp" },