From 9661cc781ed4fa2410a20320e4808517df1a79e9 Mon Sep 17 00:00:00 2001 From: Nathan Dinsmore Date: Fri, 19 Apr 2013 10:51:43 -0400 Subject: Fixed #55 Creating a variable which already exists no longer performs any action. --- objects.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index dc47375..00d457c 100644 --- a/objects.js +++ b/objects.js @@ -1675,7 +1675,7 @@ SpriteMorph.prototype.blockTemplates = function (category) { new VariableDialogMorph( null, function (pair) { - if (pair) { + if (pair && !myself.variables.silentFind(pair[0])) { myself.addVariable(pair[0], pair[1]); myself.toggleVariableWatcher(pair[0], pair[1]); myself.blocksCache[cat] = null; @@ -3796,7 +3796,7 @@ StageMorph.prototype.blockTemplates = function (category) { new VariableDialogMorph( null, function (pair) { - if (pair) { + if (pair && !myself.variables.silentFind(pair[0])) { myself.addVariable(pair[0], pair[1]); myself.toggleVariableWatcher(pair[0], pair[1]); myself.blocksCache[cat] = null; -- cgit v1.3.1