From e1ca0e6f7f9c5502da61acf6f0967444961c4bb9 Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Wed, 7 Sep 2022 02:04:33 -0400 Subject: [PATCH] Cadaver spawner fixes (#69544) fix: Fixed a runtime preventing nonhuman cadavers from spawning properly. config: Cadaver spawners will no longer yell at you when morgue_cadaver_other_species_probability is blank. config: morgue_cadaver_disable_nonhumans will now properly disable nonhuman races! (It was reversed, woops.) --- code/controllers/configuration/entries/general.dm | 2 ++ code/modules/mapping/mapping_helpers.dm | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index b21ce90ef41..235d1f1e0ad 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -637,7 +637,9 @@ /datum/config_entry/flag/morgue_cadaver_disable_nonhumans + default = FALSE /datum/config_entry/number/morgue_cadaver_other_species_probability + default = 50 /datum/config_entry/string/morgue_cadaver_override_species diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index c0e2b63bbb3..d95be2db9dd 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -485,18 +485,19 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) var/reuse_trays = (trays.len < bodycount) //are we going to spawn more trays than bodies? - var/use_species = CONFIG_GET(flag/morgue_cadaver_disable_nonhumans) + var/use_species = !(CONFIG_GET(flag/morgue_cadaver_disable_nonhumans)) var/species_probability = CONFIG_GET(number/morgue_cadaver_other_species_probability) var/override_species = CONFIG_GET(string/morgue_cadaver_override_species) var/list/usable_races if(use_species) - usable_races = GLOB.roundstart_races.Copy() + var/list/temp_list = get_selectable_species() + usable_races = temp_list.Copy() usable_races -= SPECIES_ETHEREAL //they revive on death which is bad juju LAZYREMOVE(usable_races, SPECIES_HUMAN) if(!usable_races) - stack_trace("morgue_cadaver_disable_nonhumans. THERE ARE NO VALID NONHUMANS ENABLED") + notice("morgue_cadaver_disable_nonhumans. There are no valid roundstart nonhuman races enabled. Defaulting to humans only!") if(override_species) - stack_trace("WARNING: BOTH use_all_roundstart_races_for_cadavers & morgue_cadaver_override_species CONFIGS ENABLED. morgue_cadaver_override_species BEING OVERRIDEN.") + warning("morgue_cadaver_override_species BEING OVERRIDEN since morgue_cadaver_disable_nonhumans is disabled.") else if(override_species) usable_races += override_species @@ -515,6 +516,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava) var/datum/species/new_human_species = GLOB.species_list[species_to_pick] if(new_human_species) new_human.set_species(new_human_species) + new_human_species = new_human.dna.species new_human_species.randomize_features(new_human) new_human.fully_replace_character_name(new_human.real_name, new_human_species.random_name(new_human.gender, TRUE, TRUE)) else