Files
Bubberstation/code/modules/unit_tests/cardboard_cutouts.dm
T
6df629d4a1 [MIRROR] [NO GBP] fixing issues with cutouts and potted plants (#26585)
* [NO GBP] fixing issues with cutouts and potted plants (#81570)

## About The Pull Request
This should fix #81560 and fix #81561,

## Why It's Good For The Game
Oh no, another invisibility exploit.

## Changelog

🆑
fix: fixed an issue with tactical appearance (potted plants / cardboard
cutouts) not going away after giving the item to someone else.
fix: Fixed slaughter demon cutouts being invisible. Also fixed another
issue with the tactical appearance not going away when the cardboard
cutout is pushed down.
/🆑

* [NO GBP] fixing issues with cutouts and potted plants

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-02-21 19:55:43 +01:00

34 lines
1.3 KiB
Plaintext

/// Validates that cardboard cutouts have the proper icons
/datum/unit_test/cardboard_cutouts
/datum/unit_test/cardboard_cutouts/Run()
for(var/datum/cardboard_cutout/cutout as anything in subtypesof(/datum/cardboard_cutout))
var/direct_icon = initial(cutout.direct_icon)
if(isnull(direct_icon)) //these are dynamically generated.
continue
var/direct_state = initial(cutout.direct_icon_state)
if(!icon_exists(direct_icon, direct_state))
TEST_FAIL("[cutout] has a non-existant icon state at: [direct_icon] - [direct_state]")
var/obj/item/cardboard_cutout/normal_cutout = new
test_screenshot("normal_cutout", getFlatIcon(normal_cutout))
var/obj/item/cardboard_cutout/nuclear_operative/nukie_cutout = new
test_screenshot("nukie_cutout", getFlatIcon(nukie_cutout))
nukie_cutout.push_over()
test_screenshot("nukie_cutout_pushed", getFlatIcon(nukie_cutout))
// This is the only reason we're testing xenomorphs.
// Making a custom subtype with direct_icon is hacky.
ASSERT(!isnull(/datum/cardboard_cutout/xenomorph_maid::direct_icon))
var/obj/item/cardboard_cutout/xenomorph/xenomorph_cutout = new
test_screenshot("xenomorph_cutout", getFlatIcon(xenomorph_cutout))
/obj/item/cardboard_cutout/nuclear_operative
starting_cutout = "Nuclear Operative"
/obj/item/cardboard_cutout/xenomorph
starting_cutout = "Xenomorph"