Adds a unit test for species changes keeping clothings (#69788)

* Adds a unit test for species changes keeping clothings

Adds a unit test that checks if people who species change into a Lizard keeps their non-digitigrade shoes or not, which will also affect Monkeys.
This commit is contained in:
John Willard
2022-09-13 19:10:33 -07:00
committed by GitHub
parent 97ad150115
commit 8e656a57f3
6 changed files with 35 additions and 3 deletions
+1
View File
@@ -151,6 +151,7 @@
#include "slips.dm"
#include "spawn_humans.dm"
#include "spawn_mobs.dm"
#include "species_change_clothing.dm"
#include "species_config_sanity.dm"
#include "species_unique_id.dm"
#include "species_whitelists.dm"
@@ -0,0 +1,16 @@
///Gives a Human lizard-incompatible shoes, then changes their species over to see if they drop the now incompatible shoes.
/datum/unit_test/species_change_clothing
/datum/unit_test/species_change_clothing/Run()
// Test lizards as their own thing so we can get more coverage on their features
var/mob/living/carbon/human/human_to_lizard = allocate(/mob/living/carbon/human/dummy/consistent)
human_to_lizard.equipOutfit(/datum/outfit/job/assistant/consistent)
human_to_lizard.dna.features["legs"] = DIGITIGRADE_LEGS //you WILL have digitigrade legs
var/obj/item/human_shoes = human_to_lizard.get_item_by_slot(ITEM_SLOT_FEET)
human_shoes.supports_variations_flags = NONE //do not fit lizards at all costs.
human_to_lizard.set_species(/datum/species/lizard)
var/obj/item/lizard_shoes = human_to_lizard.get_item_by_slot(ITEM_SLOT_FEET)
TEST_ASSERT_NOTEQUAL(human_shoes, lizard_shoes, "Lizard still has shoes after changing species.")