From ce3340e623fd0f03ecb15de5ec54eda8113c7c67 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Mon, 31 Mar 2014 13:19:39 +0200 Subject: let “switch to costume” block accept actual costume objects (in addition to names and numbers) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- objects.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'objects.js') diff --git a/objects.js b/objects.js index a6d2c9a..cc02ebe 100644 --- a/objects.js +++ b/objects.js @@ -2291,6 +2291,11 @@ SpriteMorph.prototype.doWearPreviousCostume = function () { }; SpriteMorph.prototype.doSwitchToCostume = function (id) { + if (id instanceof Costume) { // allow first-class costumes + this.wearCostume(id); + return; + } + var num, arr = this.costumes.asArray(), costume; -- cgit v1.3.1