Allow outfits to use an alt style without a matching PetState #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dice/fix-alt-style-outfit-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Superseded by
abea660, very similar but happened to include tests! We ran at the same time as it goes; appreciate u <3Pull request closed