From accf6c23ae76b081aec4f6a0f090fddafe29e48d Mon Sep 17 00:00:00 2001 From: faucomte97 Date: Wed, 18 Oct 2023 14:12:56 +0100 Subject: [PATCH] Clean up --- game/static/game/js/blocklyCompiler.js | 2 -- game/static/game/js/level_editor/owned_levels.js | 6 +----- game/views/level.py | 7 +++---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/game/static/game/js/blocklyCompiler.js b/game/static/game/js/blocklyCompiler.js index 3d255407f..cc181fc98 100644 --- a/game/static/game/js/blocklyCompiler.js +++ b/game/static/game/js/blocklyCompiler.js @@ -335,8 +335,6 @@ ocargo.BlocklyCompiler.prototype.createSequence = function (block) { commands.push(new DeliverCommand(block)); } else if (block.type === "sound_horn") { commands.push(new SoundHornCommand(block)); - } else if (block.type === "puff_up") { - commands.push(new PuffUpCommand(block)); } else if (block.type === "controls_repeat_until") { commands.push(this.createRepeatUntil(block)); } else if (block.type === "controls_repeat_while") { diff --git a/game/static/game/js/level_editor/owned_levels.js b/game/static/game/js/level_editor/owned_levels.js index e0116f399..079c9e915 100644 --- a/game/static/game/js/level_editor/owned_levels.js +++ b/game/static/game/js/level_editor/owned_levels.js @@ -40,13 +40,9 @@ ocargo.OwnedLevels.prototype.save = function(level, id, finishedCallback) { } this.saving.saveLevel(level, id, false, function(newId) { - delete level.name; + this.saveState.saved(level, newId); - console.log("hello") - console.log(this.levels) - console.log(this) - alert("wait") this.update(); diff --git a/game/views/level.py b/game/views/level.py index 082a4289c..43a47b032 100644 --- a/game/views/level.py +++ b/game/views/level.py @@ -210,13 +210,12 @@ def play_level(request, level, from_editor=False): model_solution = level.model_solution return_view = "level_editor" if from_editor else "levels" - print(block_data) + temp_block_data = [] - for block in block_data: - if block not in temp_block_data: - temp_block_data.append(block) + [temp_block_data.append(block) for block in block_data if block not in temp_block_data] block_data = temp_block_data + return render( request, "game/game.html",