From d44315de2c7fda133d1e2a715f586ace86a1bdea Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 13 Mar 2021 01:08:48 -0800 Subject: [PATCH] Oops, actually Static hides UCs! --- src/app/components/useOutfitAppearance.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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];