Fixed a harmless bug where the Lank would try to add new sprites to old containers.

This commit is contained in:
Scott Erickson 2014-11-23 08:51:45 -08:00
parent 692569f655
commit 1f3b02440a

View file

@ -104,7 +104,8 @@ module.exports = Lank = class Lank extends CocoClass
@sprite.destroy?() @sprite.destroy?()
if parent = @sprite.parent if parent = @sprite.parent
parent.removeChild @sprite parent.removeChild @sprite
parent.addChild newSprite if parent.spriteSheet is newSprite.spriteSheet
parent.addChild newSprite
# get the lank to update things # get the lank to update things
for prop in ['lastPos', 'currentRootAction'] for prop in ['lastPos', 'currentRootAction']