mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Handled a couple errors.
This commit is contained in:
parent
24c4051442
commit
3b7a908dcd
2 changed files with 3 additions and 3 deletions
|
@ -26,7 +26,7 @@ module.exports = class SpellToolbarView extends View
|
|||
return unless total = @callState?.statementsExecuted
|
||||
@statementIndex = Math.min(total - 1, Math.max(0, statementIndex))
|
||||
@statementRatio = @statementIndex / (total - 1)
|
||||
@statementTime = @callState.statements[@statementIndex].userInfo.time
|
||||
@statementTime = @callState.statements[@statementIndex]?.userInfo.time ? 0
|
||||
@$el.find('.bar').css('width', 100 * @statementRatio + '%')
|
||||
Backbone.Mediator.publish 'tome:spell-statement-index-updated', statementIndex: @statementIndex, ace: @ace
|
||||
@$el.find('.step-backward').prop('disabled', @statementIndex is 0)
|
||||
|
@ -83,7 +83,7 @@ module.exports = class SpellToolbarView extends View
|
|||
setCallState: (callState, statementIndex, @callIndex, @metrics) ->
|
||||
return if callState is @callState and statementIndex is @statementIndex
|
||||
return unless @callState = callState
|
||||
if not @maintainIndexHover and not @maintainIndexScrub and statementIndex? and callState.statements[statementIndex].userInfo.time isnt @statementTime
|
||||
if not @maintainIndexHover and not @maintainIndexScrub and statementIndex? and callState.statements[statementIndex]?.userInfo.time isnt @statementTime
|
||||
@setStatementIndex statementIndex
|
||||
else
|
||||
@setStatementRatio @statementRatio
|
||||
|
|
|
@ -370,7 +370,7 @@ module.exports = class SpellView extends View
|
|||
#console.log thangID, "got new castAether with raw", aether.raw, "problems", aether.problems
|
||||
spellThang.castAether = aether
|
||||
spellThang.aether = @spell.createAether e.world.getThangByID(thangID)
|
||||
#console.log thangID, @spell.spellKey, "ran", aether.metrics.callsExecuted, "times over", aether.metrics.statementsExecuted, "statements, with max recursion depth", aether.metrics.maxDepth, "and full flow/metrics", aether.metrics, aether.flow
|
||||
console.log thangID, @spell.spellKey, "ran", aether.metrics.callsExecuted, "times over", aether.metrics.statementsExecuted, "statements, with max recursion depth", aether.metrics.maxDepth, "and full flow/metrics", aether.metrics, aether.flow
|
||||
@spell.transpile()
|
||||
@updateAether false, false
|
||||
|
||||
|
|
Loading…
Reference in a new issue