mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Improvement for errors updating action of non-existent Thangs in HUD.
This commit is contained in:
parent
cec52d70f3
commit
cc3465fd6f
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue