[MIRROR] Cadaver spawner fixes [MDB IGNORE] (#16109)

* 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.)

* Cadaver spawner fixes

Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-09-08 14:27:12 +02:00
committed by GitHub
parent c247c9cda9
commit 2bd18adc8a
2 changed files with 8 additions and 4 deletions

View File

@@ -635,7 +635,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

View File

@@ -474,18 +474,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
@@ -504,6 +505,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