Files
Bubberstation/code/modules/asset_cache/assets
Penelope Haze 4437bb5ebf Check icon state existence in spritesheet insert (#86959)
## About The Pull Request
Adds a check for icon state existence in spritesheet insert, run during
unit tests.

## Why It's Good For The Game
Inserting a nonexistent icon state via `Insert()` will corrupt the
spritesheet it's inserted to, resulting in offsets being
incorrect—specifically, it results in the entire icon's contents being
inserted. This happened downstream on Doppler Shift and broke language
icons. I fixed the issue there but figured that there should be a check
upstream for it.

`if (!I || !length(icon_states(I))) // that direction or state doesn't
exist)` This check doesn't catch it, by the way. Since it returns the
entire icon file, `length(icon_states(I))` is >0. You could do
`length(icon_states) != 1`, but then it still wouldn't catch cases where
there's a single-icon-state icon *and* the icon_state is invalid. Boo. A
test like this is the best option.

I tried using the rust-g variant of icon_states and sort-of got it
working, but I figured it'd be too fragile to justify given that it
doesn't accept actual icon instances, only paths.
2024-10-04 02:47:38 +02:00
..
2024-09-10 17:04:59 +02:00
2024-07-21 13:52:21 -07:00
2024-08-01 14:45:01 +00:00