fix: fix un-equipping in avatar sandbox

This commit is contained in:
Index 2024-07-03 00:50:07 -05:00
parent e6cffdd8e2
commit aed860159b

View file

@ -561,6 +561,7 @@ function LoadWearing() {
} }
function WearAsset(details) { 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) { if (Avatar[details.type] !== details.id && Avatar.items.indexOf(details.id) === -1) {
// Equip // Equip
if (details.type === 'hat') { if (details.type === 'hat') {
@ -571,7 +572,7 @@ function WearAsset(details) {
} else { } else {
// Unequip // Unequip
if (details.type === 'hat') { if (details.type === 'hat') {
Avatar.items.splice(Avatar.items.indexOf(details.id), 1); Avatar.items.splice(Avatar.items.indexOf(ItemID), 1);
} else { } else {
Avatar[details.type] = undefined Avatar[details.type] = undefined
} }