Fix character setup preview icons rendering prior to SSAtoms initialization

- Rendering the characters involved creating mannequin mobs, prior to SSAtoms init these would not be initialized and thus have no DNA.  This prints many warning messages, causes runtimes, and ultimately the icon does not render correctly.
- Its fixed here since it seems that needing to use mobs prior to initialization is a pretty unique edge case.  Comment added to explain to future us.
This commit is contained in:
Leshana
2020-02-04 15:56:20 -05:00
parent b7da221856
commit fffd922cde

View File

@@ -1,5 +1,7 @@
/datum/preferences/update_preview_icon() // Lines up and un-overlaps character edit previews. Also un-splits taurs.
var/mob/living/carbon/human/dummy/mannequin/mannequin = get_mannequin(client_ckey)
if(!mannequin.dna) // Special handling for preview icons before SSAtoms has initailized.
mannequin.dna = new /datum/dna(null)
mannequin.delete_inventory(TRUE)
dress_preview_mob(mannequin)
COMPILE_OVERLAYS(mannequin)