Fixed #1210 based on #1313.

This commit is contained in:
Nick Winter 2014-07-13 18:53:01 -07:00
parent 1d9afbabd2
commit bd47b3bc83
2 changed files with 8 additions and 0 deletions

View file

@ -298,6 +298,9 @@ self.setupDebugWorldToRunUntilFrame = function (args) {
}
Math.random = self.debugWorld.rand.randf; // so user code is predictable
Aether.replaceBuiltin("Math", Math);
replacedLoDash = _.runInContext(self);
for(var key in replacedLoDash)
_[key] = replacedLoDash[key];
}
self.debugWorld.totalFrames = args.frame; //hack to work around error checking
self.currentDebugWorldFrame = args.frame;
@ -353,6 +356,9 @@ self.runWorld = function runWorld(args) {
}
Math.random = self.world.rand.randf; // so user code is predictable
Aether.replaceBuiltin("Math", Math);
replacedLoDash = _.runInContext(self);
for(var key in replacedLoDash)
_[key] = replacedLoDash[key];
self.postMessage({type: 'start-load-frames'});
self.world.loadFrames(self.onWorldLoaded, self.onWorldError, self.onWorldLoadProgress);
};

View file

@ -91,6 +91,8 @@ work = () ->
return
Math.random = self.world.rand.randf # so user code is predictable
Aether.replaceBuiltin('Math', Math)
replacedLoDash = _.runInContext(self)
_[key] = replacedLoDash[key] for key, val of replacedLoDash
console.log 'Loading frames.'
self.postMessage type: 'start-load-frames'