Hide Static zone for UCs, just like restricteds

This commit is contained in:
Emi Matchu 2021-03-13 00:51:13 -08:00
parent e423affa6d
commit 56dd2bbdd7

View file

@ -119,10 +119,15 @@ export function getVisibleLayers(petAppearance, itemAppearances) {
const validItemAppearances = itemAppearances.filter((a) => a); const validItemAppearances = itemAppearances.filter((a) => a);
const petLayers = petAppearance.layers.map((l) => ({ ...l, source: "pet" })); const petLayers = petAppearance.layers.map((l) => ({ ...l, source: "pet" }));
const petOccupiedZoneIds = new Set(petLayers.map((l) => l.zone.id));
const itemLayers = validItemAppearances const itemLayers = validItemAppearances
.map((a) => a.layers) .map((a) => a.layers)
.flat() .flat()
.map((l) => ({ ...l, source: "item" })); .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));
let allLayers = [...petLayers, ...itemLayers]; let allLayers = [...petLayers, ...itemLayers];
const itemRestrictedZoneIds = validItemAppearances const itemRestrictedZoneIds = validItemAppearances