Skip to content

Commit

Permalink
Look up costume index from costume list. Fix #1355 (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb authored Feb 20, 2023
1 parent ba4f4b8 commit d747adb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9093,10 +9093,10 @@ CostumeIconMorph.prototype.prepareToBeGrabbed = function () {
CostumeIconMorph.prototype.localRemoveCostume = function () {
// Only remove the costume locally for the drag
var wardrobe = this.parentThatIsA(WardrobeMorph),
idx = this.parent.children.indexOf(this),
ide = this.parentThatIsA(IDE_Morph);
ide = this.parentThatIsA(IDE_Morph),
idx = ide.currentSprite.costumes.indexOf(this.object);

wardrobe.removeCostumeAt(idx - 2);
wardrobe.removeCostumeAt(idx);
if (ide.currentSprite.costume === this.object) {
ide.currentSprite.wearCostume(null);
}
Expand Down

0 comments on commit d747adb

Please sign in to comment.