summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-03-31 13:19:39 +0200
committerjmoenig <jens@moenig.org>2014-03-31 13:19:39 +0200
commitce3340e623fd0f03ecb15de5ec54eda8113c7c67 (patch)
tree76ce71a7196470455943d00c2a7bd64c548248b3 /objects.js
parent6fd93533ecb01c27589bfe569d8e22013a77f65c (diff)
downloadsnap-yow-ce3340e623fd0f03ecb15de5ec54eda8113c7c67.tar.gz
snap-yow-ce3340e623fd0f03ecb15de5ec54eda8113c7c67.zip
let “switch to costume” block accept actual costume objects (in addition to names and numbers)
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js5
1 files changed, 5 insertions, 0 deletions
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;