Files
Bubberstation/code/modules/unit_tests/screenshot_saturnx.dm
Profakos 9f7d6dea62 Outfits that put items in your hand now respect if the outfit is visual only (#87355)
## About The Pull Request

On a downstream, we have an antagonist, that is a less competent
wizards. This antagonist's preview outfit has a beer bottle in their
hand, which has caused runtimes, as the bottle did not have any reagents
instantiated, and it tried check its length for sloshing. After putting
in a check for the `initial` argument of `on_equip`, I have noticed that
the problem goes deeper: the various procs that handle putting something
in your hand do not pass along if the items is put in your hand as a
preview or not. This PR adds a new optional var to these procs, ensuring
that unwanted behaviour during previews won't trigger.

I also swapped `visualsOnly` to snake case, as it looked inconsistent
with the rest of the code style.
 
## Why It's Good For The Game

Making the argument that ensures avoiding side effects during previews
work with all kinds of items is good.

## Changelog

🆑
fix: if an outfit puts a reagent container in the preview dummy's hand,
it will not try to slosh
code: outfits putting items in your hand will respect the visual_only
argument
/🆑
2024-10-24 15:09:50 +02:00

14 lines
694 B
Plaintext

/// A screenshot test for making sure invisible limbs function, keeping them clothed so we know they're there.
/datum/unit_test/screenshot_saturnx
/datum/unit_test/screenshot_saturnx/Run()
var/mob/living/carbon/human/human = allocate(/mob/living/carbon/human/dummy/consistent) //we don't use a dummy as they have no organs
human.equipOutfit(/datum/outfit/job/assistant/consistent, visuals_only = TRUE)
var/datum/reagent/drug/saturnx/saturnx_reagent = new()
saturnx_reagent.expose_atom(human, 15)
saturnx_reagent.turn_man_invisible(human, requires_liver = FALSE) //immediately turn us invisible
test_screenshot("invisibility", get_flat_icon_for_all_directions(human, no_anim = FALSE))