Fixed another off-by-one error

This commit is contained in:
Michael Schmatz 2014-05-07 10:20:22 -07:00
parent 6fd89f10b9
commit 806b159aab
2 changed files with 5 additions and 2 deletions
app
assets/javascripts/workers
views/play/level/tome

View file

@ -222,7 +222,10 @@ self.retrieveValueFromFrame = function retrieveValueFromFrame(args) {
{
try
{
value = _.last(_.last(self.world.userCodeMap[currentThangID][currentSpellID].flow.states).statements).variables[prop];
var flowStates = self.world.userCodeMap[currentThangID][currentSpellID].flow.states;
//we have to go to the second last flowState as we run the world for one additional frame
//to collect the flow
value = _.last(flowStates[flowStates.length - 2].statements).variables[prop];
}
catch (e)
{

View file

@ -35,7 +35,7 @@ module.exports = class DebugView extends View
handleDebugValue: (returnObject) ->
{key, value} = returnObject
unless key is @variableChain.join(".") then return
if @variableChain and not key is @variableChain.join(".") then return
@$el.find("code").text "#{key}: #{value}"
@$el.show().css(@pos)