diff --git a/app/assets/javascripts/workers/worker_world.js b/app/assets/javascripts/workers/worker_world.js index a1c4baf0f..3dcae25d2 100644 --- a/app/assets/javascripts/workers/worker_world.js +++ b/app/assets/javascripts/workers/worker_world.js @@ -289,6 +289,7 @@ self.setupDebugWorldToRunUntilFrame = function (args) { return; } Math.random = self.debugWorld.rand.randf; // so user code is predictable + Aether.replaceBuiltin("Math", Math); } self.debugWorld.totalFrames = args.frame; //hack to work around error checking self.currentDebugWorldFrame = args.frame; @@ -343,6 +344,7 @@ self.runWorld = function runWorld(args) { return; } Math.random = self.world.rand.randf; // so user code is predictable + Aether.replaceBuiltin("Math", Math); self.postMessage({type: 'start-load-frames'}); self.world.loadFrames(self.onWorldLoaded, self.onWorldError, self.onWorldLoadProgress); }; diff --git a/app/lib/Angel.coffee b/app/lib/Angel.coffee index fbdb252db..aae10c724 100644 --- a/app/lib/Angel.coffee +++ b/app/lib/Angel.coffee @@ -211,6 +211,7 @@ module.exports = class Angel extends CocoClass doSimulateWorld: (work) -> work.t1 = now() Math.random = work.testWorld.rand.randf # so user code is predictable + Aether.replaceBuiltin("Math", Math) i = 0 while i < work.testWorld.totalFrames frame = work.testWorld.getFrame i++ diff --git a/app/models/ThangType.coffee b/app/models/ThangType.coffee index e1ccf1054..84fd8e713 100644 --- a/app/models/ThangType.coffee +++ b/app/models/ThangType.coffee @@ -159,7 +159,7 @@ module.exports = class ThangType extends CocoModel spriteSheet = @builder.build() @logBuild @t0, false, @options.portraitOnly @spriteSheets[key] = spriteSheet - delete @building[key] + @building[key] = false @builder = null @options = null spriteSheet @@ -171,7 +171,7 @@ module.exports = class ThangType extends CocoModel buildQueue[0].t0 = new Date().getTime() if buildQueue[0] buildQueue[0]?.buildAsync() @spriteSheets[key] = e.target.spriteSheet - delete @building[key] + @building[key] = false @trigger 'build-complete', {key:key, thangType:@} @vectorParser = null diff --git a/app/schemas/models/user.coffee b/app/schemas/models/user.coffee index a6525bf91..5b4a93ca7 100644 --- a/app/schemas/models/user.coffee +++ b/app/schemas/models/user.coffee @@ -60,7 +60,7 @@ UserSchema = c.object {}, colorConfig: c.object {additionalProperties: c.colorConfig()} aceConfig: c.object {}, - language: {type: 'string', 'default': 'javascript', 'enum': ['javascript', 'coffeescript', 'clojure', 'lua', 'python', 'io']} + language: {type: 'string', 'default': 'javascript', 'enum': ['javascript', 'coffeescript', 'python', 'clojure', 'lua', 'io']} keyBindings: {type: 'string', 'default': 'default', 'enum': ['default', 'vim', 'emacs']} invisibles: {type: 'boolean', 'default': false} indentGuides: {type: 'boolean', 'default': false} diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 04851959e..9933033d0 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -18,9 +18,9 @@ module.exports = class SpellView extends View editModes: 'javascript': 'ace/mode/javascript' 'coffeescript': 'ace/mode/coffee' + 'python': 'ace/mode/python' 'clojure': 'ace/mode/clojure' 'lua': 'ace/mode/lua' - 'python': 'ace/mode/python' 'io': 'ace/mode/text' keyBindings: diff --git a/headless_client/worker_world.coffee b/headless_client/worker_world.coffee index e40317bfe..667481858 100644 --- a/headless_client/worker_world.coffee +++ b/headless_client/worker_world.coffee @@ -91,6 +91,7 @@ work = () -> self.onWorldError error return Math.random = self.world.rand.randf # so user code is predictable + Aether.replaceBuiltin("Math", Math) console.log "Loading frames." self.postMessage type: "start-load-frames"