mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
parent
1d9afbabd2
commit
bd47b3bc83
2 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue