From f1278b2d54e4a2443c8bb2bb9f8df9dd711dedc6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 Aug 2012 13:09:12 +0300 Subject: testxml: Fix end tag detection in attack animations. --- testxml/testxml.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'testxml/testxml.py') 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 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 or attack animation can be infinite.", False) - return framesid -- cgit v1.2.3-70-g09d2