From d2dd81c132805a34894658e2e3e33b565d285610 Mon Sep 17 00:00:00 2001 From: LilyMakesThings <127533508+LilyMakesThings@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:13:59 +0100 Subject: [PATCH] Update Assets.js --- extensions/Lily/Assets.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/Lily/Assets.js b/extensions/Lily/Assets.js index b8102890aa..b4aad45093 100644 --- a/extensions/Lily/Assets.js +++ b/extensions/Lily/Assets.js @@ -474,26 +474,26 @@ reorderCostume(args, util) { const target = util.target; - const index1 = Cast.toNumber(args.INDEX1); - const index2 = Cast.toNumber(args.INDEX2); + const index1 = Cast.toNumber(args.INDEX1) - 1; + const index2 = Cast.toNumber(args.INDEX2) - 1; const costumes = target.sprite.costumes; - if (!(0 < index1 < costumes.length + 1)) return; - if (!(0 < index2 < costumes.length + 1)) return; + if (!(0 <= index1 < costumes.length)) return; + if (!(0 <= index2 < costumes.length)) return; - target.reorderCostume(index1 - 1, index2 - 1); + target.reorderCostume(index1, index2); } reorderSound(args, util) { const target = util.target; - const index1 = Cast.toNumber(args.INDEX1); - const index2 = Cast.toNumber(args.INDEX2); + const index1 = Cast.toNumber(args.INDEX1) - 1; + const index2 = Cast.toNumber(args.INDEX2) - 1; const sounds = target.sprite.sounds; - if (!(0 < index1 < sounds.length + 1)) return; - if (!(0 < index2 < sounds.length + 1)) return; + if (!(0 <= index1 < sounds.length)) return; + if (!(0 <= index2 < sounds.length)) return; - target.reorderSound(index1 - 1, index2 - 1); + target.reorderSound(index1, index2); } getCostumeData(args, util) {