Files
Bubberstation/code/modules/unit_tests/bee.dm
MrMelbert c26ea16c4f Fix dead bees not being their proper bee self (#87150)
## About The Pull Request

Fixes #87147

Whomever refactored bees null'd the beegent before spawning the corpse,
and we pass the bee by ref into corpse init to grab beegent

## Changelog

🆑 Melbert
fix: Dead bees maintain their color and reagents
/🆑
2024-10-11 21:23:02 +03:00

16 lines
721 B
Plaintext

/// Test beegent transfer
/datum/unit_test/beegent
/datum/unit_test/beegent/Run()
var/mob/living/basic/bee/bee = allocate(__IMPLIED_TYPE__)
var/turf/bee_turf = get_turf(bee)
var/datum/reagent/picked = GLOB.chemical_reagents_list[/datum/reagent/toxin/fentanyl]
bee.assign_reagent(picked)
bee.death()
var/obj/item/trash/bee/dead_bee = locate() in bee_turf
TEST_ASSERT_NOTNULL(dead_bee, "The bee did not leave a corpse.")
TEST_ASSERT_EQUAL(dead_bee.beegent, picked, "The bee's corpse did not have the correct beegent assigned.")
TEST_ASSERT(dead_bee.reagents.has_reagent(/datum/reagent/toxin/fentanyl), "The bee's corpse did not contain any of the beegent.")
// clean up, we aren't allocated
QDEL_NULL(dead_bee)