Logic & comment updates to #30
Tested this out and compared to Dice's other work in Neobot and I think the condition should be the other way around, as it is here? (I found myself starting to write the explanatory comment, and realizing it wasn't making sense, then going heyyy wait a minute lol)
This commit is contained in:
parent
60d2f9a014
commit
f2832a3bde
1 changed files with 13 additions and 11 deletions
|
@ -22,14 +22,9 @@ function getVisibleLayers(petAppearance, itemAppearances) {
|
|||
.flat()
|
||||
.map((z) => z.id)
|
||||
);
|
||||
const petOccupiedZoneIds = new Set(petLayers.map((l) => l.zone.id));
|
||||
const petRestrictedZoneIds = new Set(
|
||||
petAppearance.restrictedZones.map((z) => z.id)
|
||||
);
|
||||
const petOccupiedOrRestrictedZoneIds = new Set([
|
||||
...petOccupiedZoneIds,
|
||||
...petRestrictedZoneIds,
|
||||
]);
|
||||
|
||||
const visibleLayers = allLayers.filter((layer) => {
|
||||
// When an item restricts a zone, it hides pet layers of the same zone.
|
||||
|
@ -42,11 +37,11 @@ function getVisibleLayers(petAppearance, itemAppearances) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// When a pet appearance restricts or occupies a zone, or when the pet is
|
||||
// Unconverted, it makes body-specific items incompatible. We use this to
|
||||
// disallow UCs from wearing certain body-specific Biology Effects,
|
||||
// Statics, etc, while still allowing non-body-specific items in those
|
||||
// zones! (I think this happens for some Invisible pet stuff, too?)
|
||||
// When a pet appearance restricts a zone, or when the pet is Unconverted,
|
||||
// it makes body-specific items incompatible. We use this to disallow UCs
|
||||
// from wearing certain body-specific Biology Effects, Statics, etc, while
|
||||
// still allowing non-body-specific items in those zones! (I think this
|
||||
// happens for some Invisible pet stuff, too?)
|
||||
//
|
||||
// TODO: We shouldn't be *hiding* these zones, like we do with items; we
|
||||
// should be doing this way earlier, to prevent the item from even
|
||||
|
@ -59,6 +54,13 @@ function getVisibleLayers(petAppearance, itemAppearances) {
|
|||
// stability, and *then* rely on the UI to respect that ordering when
|
||||
// rendering them by depth. Not great! 😅)
|
||||
//
|
||||
// NOTE: We used to also include the pet appearance's *occupied* zones in
|
||||
// this condition, not just the restricted zones, as a sensible
|
||||
// defensive default, even though we weren't aware of any relevant
|
||||
// items. But now we know that actually the "Bruce Brucey B Mouth"
|
||||
// occupies the real Mouth zone, and still should be visible and
|
||||
// above pet layers! So, we now only check *restricted* zones.
|
||||
//
|
||||
// NOTE: UCs used to implement their restrictions by listing specific
|
||||
// zones, but it seems that the logic has changed to just be about
|
||||
// UC-ness and body-specific-ness, and not necessarily involve the
|
||||
|
@ -74,7 +76,7 @@ function getVisibleLayers(petAppearance, itemAppearances) {
|
|||
layer.source === "item" &&
|
||||
layer.bodyId !== "0" &&
|
||||
(petAppearance.pose === "UNCONVERTED" ||
|
||||
petOccupiedZoneIds.has(layer.zone.id))
|
||||
petRestrictedZoneIds.has(layer.zone.id))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue