From 3b7a908dcd77c6f9f8a7ccf1f18105c9629e8a47 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 22 Jan 2014 10:56:49 -0800 Subject: [PATCH] Handled a couple errors. --- app/views/play/level/tome/spell_toolbar_view.coffee | 4 ++-- app/views/play/level/tome/spell_view.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/play/level/tome/spell_toolbar_view.coffee b/app/views/play/level/tome/spell_toolbar_view.coffee index 573689742..16870f85f 100644 --- a/app/views/play/level/tome/spell_toolbar_view.coffee +++ b/app/views/play/level/tome/spell_toolbar_view.coffee @@ -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 diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 7d319cef4..f648ab9c8 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -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