[MIRROR] Avoid wasted work creating body parts that are just going to be destroyed [0.3s of init] [MDB IGNORE] (#18125)

* Avoid wasted work creating body parts that are just going to be destroyed [0.3s of init] (#71916)

Current process:
- Human created
- Body parts created for basic human
- Species set
- Body parts torn down, recreated

New process:
- Human created
- Species set
- Body parts created then and there

I think the same is being done to organs, can be adjusted.

Set species was also being invoked asynchronously, but it's not clear
why, and SHOULD_NOT_SLEEP indicates nothing sleeps, so alas. This isn't
done for init, just for consistency.

Reorders init a little to accomodate the body parts not necessarily
being there, huds now need to safety check.

Saves about 0.3s of init. Closes
https://github.com/tgstation/dev-cycles-initiative/issues/18

* Avoid wasted work creating body parts that are just going to be destroyed [0.3s of init]

* update modular

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Funce <funce.973@gmail.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-01-06 16:29:15 +01:00
committed by GitHub
parent 7d73f0ec65
commit dc9294dff2
9 changed files with 66 additions and 25 deletions
+1 -1
View File
@@ -35,7 +35,7 @@
human.dna.blood_type = random_blood_type()
human.dna.features["mcolor"] = "#[random_color()]"
human.dna.species.randomize_active_underwear(human)
human.dna.species.randomize_active_underwear_only(human)
for(var/datum/species/species_path as anything in subtypesof(/datum/species))
var/datum/species/new_species = new species_path