Fixed bug with trying to play selection sound for nonexistent sprites.

This commit is contained in:
Nick Winter 2014-05-16 10:03:45 -07:00
parent 7811bda6c3
commit c1052d8d7e

View file

@ -273,7 +273,7 @@ module.exports = class SpriteBoss extends CocoClass
@selectedSprite?.selected = false
sprite?.selected = true
@selectedSprite = sprite
alive = not (sprite?.thang.health < 0)
alive = sprite and not (sprite.thang.health < 0)
Backbone.Mediator.publish 'surface:sprite-selected',
thang: if sprite then sprite.thang else null