Allow outfits to use an alt style without a matching PetState #6

Closed
dice wants to merge 1 commit from dice/fix-alt-style-outfit-validation into main AGit
Contributor

Outfit#biology= looks up a PetState for the given species/color/pose, and
validates its presence - but alt styles are meant to replace the pet's
body regardless of pose, and there's often no PetState at pose UNKNOWN for
a given species/color, so that lookup fails and the whole outfit becomes
invalid, even though visible_layers already correctly uses the alt
style's own layers instead. This surfaced as an HTTP 400 from
outfits/new.png for any alt-style pet rendered with pose=UNKNOWN.

Makes the PetState presence validation conditional on there being no alt
style, and has pet_type/pose fall back to the alt style (which has its own
species/color) instead of raising when pet_state is nil. Also guards the
UNCONVERTED-specific item filtering in visible_layers, which previously
assumed pet_state was always present.

Outfit#biology= looks up a PetState for the given species/color/pose, and validates its presence - but alt styles are meant to replace the pet's body regardless of pose, and there's often no PetState at pose UNKNOWN for a given species/color, so that lookup fails and the whole outfit becomes invalid, even though visible_layers already correctly uses the alt style's own layers instead. This surfaced as an HTTP 400 from outfits/new.png for any alt-style pet rendered with pose=UNKNOWN. Makes the PetState presence validation conditional on there being no alt style, and has pet_type/pose fall back to the alt style (which has its own species/color) instead of raising when pet_state is nil. Also guards the UNCONVERTED-specific item filtering in visible_layers, which previously assumed pet_state was always present.
Outfit#biology= looks up a PetState for the given species/color/pose, and
validates its presence - but alt styles are meant to replace the pet's
body regardless of pose, and there's often no PetState at pose UNKNOWN for
a given species/color, so that lookup fails and the whole outfit becomes
invalid, even though visible_layers already correctly uses the alt
style's own layers instead. This surfaced as an HTTP 400 from
outfits/new.png for any alt-style pet rendered with pose=UNKNOWN.

Makes the PetState presence validation conditional on there being no alt
style, and has pet_type/pose fall back to the alt style (which has its own
species/color) instead of raising when pet_state is nil. Also guards the
UNCONVERTED-specific item filtering in visible_layers, which previously
assumed pet_state was always present.
Owner

Superseded by abea660, very similar but happened to include tests! We ran at the same time as it goes; appreciate u <3

Superseded by abea660, very similar but happened to include tests! We ran at the same time as it goes; appreciate u <3
matchu closed this pull request 2026-08-26 16:17:39 -07:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OpenNeo/impress!6
No description provided.