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:
parent
eaab0b1922
commit
fe6264b20a
1 changed files with 2 additions and 1 deletions
|
@ -526,7 +526,8 @@ class Item < ApplicationRecord
|
||||||
|
|
||||||
# If there are no body-specific assets, return one appearance for them all.
|
# If there are no body-specific assets, return one appearance for them all.
|
||||||
if swf_assets_by_body_id.empty?
|
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
|
end
|
||||||
|
|
||||||
# Otherwise, create an appearance for each real (nonzero) body ID. We don't
|
# Otherwise, create an appearance for each real (nonzero) body ID. We don't
|
||||||
|
|
Loading…
Reference in a new issue