Optimize cardboard cutouts saving 1.5s+ on init times (#73404)

New regression in init times. Closes
https://github.com/tgstation/dev-cycles-initiative/issues/32. CC @Fikou

- Instead of creating a human and icon for *every* cardboard cutout when
initialized, only creates the one we're actually using. When you're
about to use a crayon, creates all of them.
- Instead of using getFlatIcon, uses appearances directly.
This commit is contained in:
Mothblocks
2023-02-18 22:58:35 -07:00
committed by GitHub
parent 1191bce9b0
commit 09cfba5feb
23 changed files with 124 additions and 74 deletions
@@ -32,7 +32,7 @@
/mob/living/basic/syndicate/Initialize(mapload)
. = ..()
apply_dynamic_human_icon(src, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand)
apply_dynamic_human_appearance(src, mob_spawn_path = mob_spawner, r_hand = r_hand, l_hand = l_hand)
if(LAZYLEN(loot))
AddElement(/datum/element/death_drops, loot)
AddElement(/datum/element/footstep, footstep_type = FOOTSTEP_MOB_SHOE)