From aed860159bef9836a304d81864f7834c0f7894fe Mon Sep 17 00:00:00 2001 From: Index Date: Wed, 3 Jul 2024 00:50:07 -0500 Subject: [PATCH] fix: fix un-equipping in avatar sandbox --- js/account/avatar-sandbox-rewrite.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/account/avatar-sandbox-rewrite.js b/js/account/avatar-sandbox-rewrite.js index 8f360a6..2bb04e7 100644 --- a/js/account/avatar-sandbox-rewrite.js +++ b/js/account/avatar-sandbox-rewrite.js @@ -561,6 +561,7 @@ function LoadWearing() { } function WearAsset(details) { + const ItemID = Object.keys(ItemCache)[Object.values(ItemCache).indexOf(details)] if (Avatar[details.type] !== details.id && Avatar.items.indexOf(details.id) === -1) { // Equip if (details.type === 'hat') { @@ -571,7 +572,7 @@ function WearAsset(details) { } else { // Unequip if (details.type === 'hat') { - Avatar.items.splice(Avatar.items.indexOf(details.id), 1); + Avatar.items.splice(Avatar.items.indexOf(ItemID), 1); } else { Avatar[details.type] = undefined }