Improvement for errors updating action of non-existent Thangs in HUD.

This commit is contained in:
Nick Winter 2014-02-05 15:54:34 -08:00
parent cec52d70f3
commit cc3465fd6f
2 changed files with 4 additions and 2 deletions

View file

@ -64,6 +64,8 @@ module.exports = class HUDView extends View
onNewWorld: (e) ->
@thang = e.world.thangMap[@thang.id] if @thang
if not @thang
@setThang null, null
setThang: (thang, thangType) ->
unless @speaker
@ -281,7 +283,7 @@ module.exports = class HUDView extends View
return unless @thang.world and not _.isEmpty @thang.actions
@buildActionTimespans() unless @timespans
for actionName, action of @thang.actions
@updateActionElement(actionName, @timespans[actionName], @thang.action.name is actionName)
@updateActionElement(actionName, @timespans[actionName], @thang.action is actionName)
tableContainer = @$el.find('.table-container')
timelineWidth = tableContainer.find('.action-timeline').width()
right = (1 - (@timeProgress ? 0)) * timelineWidth

View file

@ -64,7 +64,7 @@ module.exports = class TomeView extends View
@castButton = @insertSubView new CastButtonView spells: @spells
else
@cast()
console.log "Warning: There are no Programmable Thangs in this level, which makes it unplayable."
console.warn "Warning: There are no Programmable Thangs in this level, which makes it unplayable."
onNewWorld: (e) ->
oldThangs = @thangList.thangs