This commit is contained in:
Nick Winter 2014-04-29 15:31:18 -07:00
parent eca35ce371
commit bea0589fad

View file

@ -336,7 +336,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
@warnedFor ?= {} @warnedFor ?= {}
console.warn 'Cannot show action', action, 'for', @thangType.get('name'), 'because it DNE' unless @warnedFor[action] console.warn 'Cannot show action', action, 'for', @thangType.get('name'), 'because it DNE' unless @warnedFor[action]
@warnedFor[action] = true @warnedFor[action] = true
return null return if @action is 'idle' then null else 'idle'
action = 'break' if @actions.break? and @thang?.erroredOut action = 'break' if @actions.break? and @thang?.erroredOut
action = 'die' if @actions.die? and thang?.health? and thang.health <= 0 action = 'die' if @actions.die? and thang?.health? and thang.health <= 0
@actions[action] @actions[action]