summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-23 12:39:11 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-23 12:39:11 -0300
commitb6e0367c758c9064cf5054d08ca36409d96512b5 (patch)
tree06701a2c9d16fe6421a5d256d60bb52026fb28cf
parent9387caf1e412f0771ecaa5bf506727cda0a4f5f4 (diff)
downloadevol-tools-b6e0367c758c9064cf5054d08ca36409d96512b5.tar.gz
evol-tools-b6e0367c758c9064cf5054d08ca36409d96512b5.tar.bz2
evol-tools-b6e0367c758c9064cf5054d08ca36409d96512b5.tar.xz
evol-tools-b6e0367c758c9064cf5054d08ca36409d96512b5.zip
Fail if map is added without heights
I mean, tmx_converter will fail anyway, so this should fail first
-rwxr-xr-xtestxml/testxml.py7
1 files changed, 7 insertions, 0 deletions
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: