summaryrefslogtreecommitdiff
path: root/testxml/testxml.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-05 21:16:18 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-05 21:16:18 +0300
commit0d0ce339f9adbcc88e8477b2ac32f61620acf6d3 (patch)
tree7918933ad45c5940873a8daa85eb0363d416d6cf /testxml/testxml.py
parent6483537c7b9de943104de46bba8ce357f3d26251 (diff)
downloadtools-0d0ce339f9adbcc88e8477b2ac32f61620acf6d3.tar.gz
tools-0d0ce339f9adbcc88e8477b2ac32f61620acf6d3.tar.bz2
tools-0d0ce339f9adbcc88e8477b2ac32f61620acf6d3.tar.xz
tools-0d0ce339f9adbcc88e8477b2ac32f61620acf6d3.zip
testxml: add check for last attack tag.
Diffstat (limited to 'testxml/testxml.py')
-rwxr-xr-xtestxml/testxml.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index 23b3ad5..3340db5 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -619,7 +619,8 @@ def testSpriteFile(id, fullPath, file, fileLoc, dnum, variant, checkAction, iser
def testSpriteAction(file, name, action, numframes, iserr):
framesid = set()
-
+
+ lastAttack = None
try:
animations = action.getElementsByTagName("animation")
except:
@@ -653,6 +654,9 @@ def testSpriteAction(file, name, action, numframes, iserr):
labels = set()
for node2 in animation.childNodes:
+ if name == "attack" and node2.nodeName != "#text":
+ lastAttack = node2.nodeName
+
if node2.nodeName in delayTags:
try:
delay = int(node2.attributes["delay"].value)
@@ -862,6 +866,10 @@ def testSpriteAction(file, name, action, numframes, iserr):
if delay > 0 and delay < 5000:
showMsgSprite(file, "last frame\sequence in dead animation have to low limit. Need zero or >5000: " + name, False)
+ elif name == "attack":
+ if lastAttack is not None and lastAttack != "end":
+ showMsgSprite(file, "last attack tag should be <end/> or attack animation can be infinite.", False)
+
return framesid