summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-08 13:09:12 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-08 13:09:12 +0300
commitf1278b2d54e4a2443c8bb2bb9f8df9dd711dedc6 (patch)
treeb8a27f1bc912be6a09e7699e40b817ae1748bfe8
parent0062ba31ec37b17a6c194028604ab523530f94e1 (diff)
downloadtools-f1278b2d54e4a2443c8bb2bb9f8df9dd711dedc6.tar.gz
tools-f1278b2d54e4a2443c8bb2bb9f8df9dd711dedc6.tar.bz2
tools-f1278b2d54e4a2443c8bb2bb9f8df9dd711dedc6.tar.xz
tools-f1278b2d54e4a2443c8bb2bb9f8df9dd711dedc6.zip
testxml: Fix end tag detection in attack animations.
-rwxr-xr-xtestxml/testxml.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index 14f4d2f..d9b1197 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -628,7 +628,6 @@ 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:
@@ -644,6 +643,7 @@ def testSpriteAction(file, name, action, numframes, iserr):
delayTags = ("frame", "sequence", "pause")
for animation in animations:
+ lastAttack = None
try:
direction = animation.attributes["direction"].value
except:
@@ -840,6 +840,12 @@ def testSpriteAction(file, name, action, numframes, iserr):
if cnt == 0:
showMsgSprite(file, "no frames or sequences in action: " + name, iserr)
+ if name == "attack":
+ if lastAttack is not None and lastAttack != "end":
+ showMsgSprite(file, "last attack tag should be <end/> or attack animation "\
+ "can be infinite. direction: " + direction, False)
+
+
if "default" not in aniset:
if "down" not in aniset:
showMsgSprite(file, "no down direction in animation: " + name, iserr)
@@ -874,10 +880,6 @@ 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