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.)
This commit is contained in:
ShizCalev
2022-09-06 23:04:33 -07:00
committed by GitHub
parent 3f84b0b292
commit e1ca0e6f7f
2 changed files with 8 additions and 4 deletions
+6 -4
View File
@@ -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