mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-04 18:03:45 -04: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
app/views/play/level
|
@ -64,6 +64,8 @@ module.exports = class HUDView extends View
|
||||||
|
|
||||||
onNewWorld: (e) ->
|
onNewWorld: (e) ->
|
||||||
@thang = e.world.thangMap[@thang.id] if @thang
|
@thang = e.world.thangMap[@thang.id] if @thang
|
||||||
|
if not @thang
|
||||||
|
@setThang null, null
|
||||||
|
|
||||||
setThang: (thang, thangType) ->
|
setThang: (thang, thangType) ->
|
||||||
unless @speaker
|
unless @speaker
|
||||||
|
@ -281,7 +283,7 @@ module.exports = class HUDView extends View
|
||||||
return unless @thang.world and not _.isEmpty @thang.actions
|
return unless @thang.world and not _.isEmpty @thang.actions
|
||||||
@buildActionTimespans() unless @timespans
|
@buildActionTimespans() unless @timespans
|
||||||
for actionName, action of @thang.actions
|
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')
|
tableContainer = @$el.find('.table-container')
|
||||||
timelineWidth = tableContainer.find('.action-timeline').width()
|
timelineWidth = tableContainer.find('.action-timeline').width()
|
||||||
right = (1 - (@timeProgress ? 0)) * timelineWidth
|
right = (1 - (@timeProgress ? 0)) * timelineWidth
|
||||||
|
|
|
@ -64,7 +64,7 @@ module.exports = class TomeView extends View
|
||||||
@castButton = @insertSubView new CastButtonView spells: @spells
|
@castButton = @insertSubView new CastButtonView spells: @spells
|
||||||
else
|
else
|
||||||
@cast()
|
@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) ->
|
onNewWorld: (e) ->
|
||||||
oldThangs = @thangList.thangs
|
oldThangs = @thangList.thangs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue