Fixed two bugs with destroying sprites.

This commit is contained in:
Nick Winter 2014-03-14 17:15:07 -07:00
parent 357b73be93
commit fc7d403785
2 changed files with 3 additions and 2 deletions

View file

@ -205,6 +205,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
.to({alpha: 0.6, scaleY: @options.camera.y2x, scaleX: 1}, 100, createjs.Ease.circOut)
.to({alpha: 0, scaleY: 0, scaleX: 0}, 700, createjs.Ease.circIn)
.call =>
return if @destroyed
@options.groundLayer.removeChild circle
delete @handledAoEs[event]

View file

@ -300,7 +300,7 @@ module.exports = class SpriteBoss extends CocoClass
@willSelectThang = [thangID, null]
@updateTarget()
return unless @selectionMark
@selectedSprite = null unless @selectedSprite?.thang
@selectedSprite = null if @selectedSprite and (@selectedSprite.destroyed or not @selectedSprite.thang)
@selectionMark.toggle @selectedSprite?
@selectionMark.setSprite @selectedSprite
@selectionMark.update()