diff --git a/src/app/components/useOutfitAppearance.js b/src/app/components/useOutfitAppearance.js index 811f658..edf1866 100644 --- a/src/app/components/useOutfitAppearance.js +++ b/src/app/components/useOutfitAppearance.js @@ -118,15 +118,17 @@ export function getVisibleLayers(petAppearance, itemAppearances) { const validItemAppearances = itemAppearances.filter((a) => a); - const petLayers = petAppearance.layers.map((l) => ({ ...l, source: "pet" })); - const petOccupiedZoneIds = new Set(petLayers.map((l) => l.zone.id)); - const itemLayers = validItemAppearances .map((a) => a.layers) .flat() - .map((l) => ({ ...l, source: "item" })) - // Don't let items occupy the same zones as the pet, e.g. Static on UCs. - .filter((l) => !petOccupiedZoneIds.has(l.zone.id)); + .map((l) => ({ ...l, source: "item" })); + const itemOccupiedZoneIds = new Set(itemLayers.map((l) => l.zone.id)); + + const petLayers = petAppearance.layers + .map((l) => ({ ...l, source: "pet" })) + // Copying weird Neopets.com behavior: if an item occupies a zone that the + // pet also occupies, the pet's corresponding zone is hidden. + .filter((l) => !itemOccupiedZoneIds.has(l.zone.id)); let allLayers = [...petLayers, ...itemLayers];