Oops, actually Static hides UCs!
This commit is contained in:
parent
56dd2bbdd7
commit
d44315de2c
1 changed files with 8 additions and 6 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue