mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-01 03:16:56 -05:00
Made the level editor not break when using units that are incomplete.
This commit is contained in:
parent
684c76194d
commit
e8da248302
1 changed files with 6 additions and 3 deletions
|
@ -323,7 +323,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
if not action and @thang?.actionActivated and not @stopLogging
|
if not action and @thang?.actionActivated and not @stopLogging
|
||||||
console.error "action is", action, "for", @thang?.id, "from", @currentRootAction, @thang.action, @thang.getActionName?()
|
console.error "action is", action, "for", @thang?.id, "from", @currentRootAction, @thang.action, @thang.getActionName?()
|
||||||
@stopLogging = true
|
@stopLogging = true
|
||||||
@queueAction(action) if isDifferent or (@thang?.actionActivated and action.name isnt 'move')
|
@queueAction(action) if action and (isDifferent or (@thang?.actionActivated and action.name isnt 'move'))
|
||||||
@updateActionDirection()
|
@updateActionDirection()
|
||||||
|
|
||||||
determineAction: ->
|
determineAction: ->
|
||||||
|
@ -332,8 +332,11 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
||||||
action = thang.action if thang?.acts
|
action = thang.action if thang?.acts
|
||||||
action ?= @currentRootAction.name if @currentRootAction?
|
action ?= @currentRootAction.name if @currentRootAction?
|
||||||
action ?= 'idle'
|
action ?= 'idle'
|
||||||
action = null unless @actions[action]?
|
unless @actions[action]?
|
||||||
return null unless action
|
@warnedFor ?= {}
|
||||||
|
console.warn 'Cannot show action', action, 'for', @thangType.get('name'), 'because it DNE' unless @warnedFor[action]
|
||||||
|
@warnedFor[action] = true
|
||||||
|
return null
|
||||||
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]
|
||||||
|
|
Loading…
Reference in a new issue