From b6e0367c758c9064cf5054d08ca36409d96512b5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 23 Apr 2020 12:39:11 -0300 Subject: Fail if map is added without heights I mean, tmx_converter will fail anyway, so this should fail first --- testxml/testxml.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testxml/testxml.py b/testxml/testxml.py index 83723ab..85401d5 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -1571,6 +1571,7 @@ def testMap(mapName, file, path): fringe = None collision = None + heightLayer = None lowLayers = [] overLayers = [] beforeFringe = True @@ -1590,6 +1591,10 @@ def testMap(mapName, file, path): if collision is not None: showMsgFile(file, "duplicate Collision layer", True) collision = obj + elif name.lower() == "height" or name.lower() == "heights": + if heightLayer is not None: + showMsgFile(file, "duplicate Height layer", True) + heightLayer = obj elif beforeFringe == True: lowLayers.append(obj) else: @@ -1619,6 +1624,8 @@ def testMap(mapName, file, path): showMsgFile(file, "missing fringe layer", True) if collision == None: showMsgFile(file, "missing collision layer", True) + if heightLayer == None: + showMsgFile(file, "missing heights layer", True) elif mapName != "test.tmx" and mapName != "testbg.tmx": ids = testCollisionLayer(file, collision, tilesMap) if ids[0] != None and len(ids[0]) > 0: -- cgit v1.2.3-60-g2f50