Files
Bubberstation/code/modules/admin
SkyratBot e39a44e462 [MIRROR] Fixes display of appearance type in VV [MDB IGNORE] (#24092)
* Fixes display of appearance type in VV (#78725)

## About The Pull Request

Appearance vars are awful to detect. They have a type var you can
access, for an appearance the value of this var is `/image`. However
`istype(appearance, /image) == 0`. This is good enough for
identification, you might think this just means detecting appearance
would be something like `if(thing.type == /image && !istype(thing,
/image))`, but there's a problem with this: `istype(appearance, /datum)
== 0`. For that matter it seems like all istypes that check if an
appearance is some type fail, so you can't know that it's safe to access
the `.type` var to do that earlier combined check.

Now we get into magic territory, `istype(new /image, appearance) == 1`.
I have no clue internally why this is the case but it seems to be unique
to appearances, and so can be used to identify them from a previously
unknown var. You have to rule out that the thing you're checking is a
path, it would pass the check if the value were `/image` then, but this
is simple enough.

I hate having to know all this, so now you know this too.

🆑 ninjanomnom
admin: Appearance vars in VV now display instead of being left blank
/🆑

* Fixes display of appearance type in VV

---------

Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
2023-10-03 15:13:32 -04:00
..