From fffd922cde463be9a5a246b9ef8371384b81ecf5 Mon Sep 17 00:00:00 2001 From: Leshana Date: Tue, 4 Feb 2020 15:56:20 -0500 Subject: [PATCH] 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. --- code/modules/mob/new_player/preferences_setup_vr.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/new_player/preferences_setup_vr.dm b/code/modules/mob/new_player/preferences_setup_vr.dm index 8b1760c65c..04910731c1 100644 --- a/code/modules/mob/new_player/preferences_setup_vr.dm +++ b/code/modules/mob/new_player/preferences_setup_vr.dm @@ -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)