Use an actual body with ID "0", instead of the string "all"

I changed my mind again! At first I wanted to make the special case
clearer, and to be able to more strongly assert that the species is
not null. But now I'm like… eh, there's code that references `body.id`
that has no reason _not_ to work in the all-bodies case… let's just
keep the types more consistent, I think.
This commit is contained in:
Emi Matchu 2023-11-11 08:13:07 -08:00
parent eaab0b1922
commit fe6264b20a

View file

@ -526,7 +526,8 @@ class Item < ApplicationRecord
# If there are no body-specific assets, return one appearance for them all.
if swf_assets_by_body_id.empty?
return [Appearance.new(:all, swf_assets_for_all_bodies)]
body = Body.new(0, nil)
return [Appearance.new(body, swf_assets_for_all_bodies)]
end
# Otherwise, create an appearance for each real (nonzero) body ID. We don't