summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-07-24 08:04:00 +0200
committerjmoenig <jens@moenig.org>2014-07-24 08:04:00 +0200
commit1b382458c8208cb74b51cad414e67a71be61e0e2 (patch)
treef4104d099ae22f636276f17428d26e2d939e83e4
parent2fbdf855c25b92d5d5508e2c89546a95812f7a5a (diff)
downloadsnap-byow-1b382458c8208cb74b51cad414e67a71be61e0e2.tar.gz
snap-byow-1b382458c8208cb74b51cad414e67a71be61e0e2.zip
fixed “lost sprites bug”
ensure duplicated sprites keep wearing their current costume through save and re-load
-rwxr-xr-xhistory.txt4
-rw-r--r--objects.js9
2 files changed, 11 insertions, 2 deletions
diff --git a/history.txt b/history.txt
index af11d16..73f2a6b 100755
--- a/history.txt
+++ b/history.txt
@@ -2222,3 +2222,7 @@ ______
140723
------
* Objects: Scale down oversized images to current stage dimensions. Thanks, Dan, for reporting this!
+
+140724
+------
+* Objects: fixed “lost sprites bug” - ensure duplicated sprites keep wearing their current costume through save and re-load
diff --git a/objects.js b/objects.js
index a1059a5..d378b75 100644
--- a/objects.js
+++ b/objects.js
@@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.objects = '2014-July-23';
+modules.objects = '2014-July-24';
var SpriteMorph;
var StageMorph;
@@ -1331,6 +1331,7 @@ SpriteMorph.prototype.init = function (globals) {
SpriteMorph.prototype.fullCopy = function () {
var c = SpriteMorph.uber.fullCopy.call(this),
+ myself = this,
arr = [],
cb;
@@ -1352,7 +1353,11 @@ SpriteMorph.prototype.fullCopy = function () {
});
});
this.costumes.asArray().forEach(function (costume) {
- arr.push(costume.copy());
+ var cst = costume.copy();
+ arr.push(cst);
+ if (costume === myself.costume) {
+ c.costume = cst;
+ }
});
c.costumes = new List(arr);
arr = [];