summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--objects.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/objects.js b/objects.js
index eb3f5fc..6e49f43 100644
--- a/objects.js
+++ b/objects.js
@@ -4084,7 +4084,10 @@ SpriteMorph.prototype.reactToDropOf = function (morph, hand) {
morph.slideBackTo(hand.grabOrigin);
};
-var re = /\((\d+)\)$/; // RegExp to match costume names
+// SpriteMorph screenshots
+
+SpriteMorph.prototype.re = /\((\d+)\)$/; // RegExp to match costume names
+
SpriteMorph.prototype.newCostumeName = function (name) {
var foundSameName = false,
foundIndex = false,
@@ -4100,7 +4103,7 @@ SpriteMorph.prototype.newCostumeName = function (name) {
foundSameName = true;
}
if (foundSameName) {
- p = re.exec(costume.name);
+ p = this.re.exec(costume.name);
if (p) {
lastIndex = Number(p[1]);
foundIndex = true;