Properly skip tweens for shadows we removed during sprite parsing

This commit is contained in:
Nick Winter 2016-02-22 13:11:46 -08:00
parent 956f9dc43d
commit 99acf2d40e
2 changed files with 7 additions and 1 deletions

View file

@ -31,6 +31,7 @@ module.exports = class SpriteBuilder
for func in tweenData
args = _.cloneDeep(func.a)
@dereferenceArgs(args, locals)
console.log 'found', args, 'for', func.n
tween = tween[func.n](args...)
anim.timeline.addTween(tween)

View file

@ -153,7 +153,12 @@ module.exports = class SegmentedSprite extends createjs.SpriteContainer
# console.debug 'Did not dereference args:', args
stopped = true
break
tween = tween[func.n](args...)
if tween[func.n]
tween = tween[func.n](args...)
else
# If we, say, skipped a shadow get(), then the wait() may not be present
stopped = true
break
continue if stopped
anim.timeline.addTween(tween)