From a218903eab3fedc6867e1fa3557369fb8c4ea477 Mon Sep 17 00:00:00 2001 From: Charlie Nolan Date: Tue, 7 Jan 2025 12:31:50 -0800 Subject: [PATCH] Make character previews not stack trace (#27871) --- code/modules/client/preference/character.dm | 2 +- code/modules/mob/living/carbon/carbon_life.dm | 3 +++ code/modules/mob/living/carbon/carbon_procs.dm | 2 +- code/modules/mob/living/carbon/human/human_defines.dm | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preference/character.dm b/code/modules/client/preference/character.dm index 4a08a3e2291..30b169bf571 100644 --- a/code/modules/client/preference/character.dm +++ b/code/modules/client/preference/character.dm @@ -831,7 +831,7 @@ var/coloured_tail if(current_species) if(current_species.bodyflags & HAS_ICON_SKIN_TONE) //Handling species-specific icon-based skin tones by flagged race. - var/mob/living/carbon/human/H = new + var/mob/living/carbon/human/fake/H = new H.dna.species = current_species H.s_tone = s_tone H.dna.species.updatespeciescolor(H, 0) //The mob's species wasn't set, so it's almost certainly different than the character's species at the moment. Thus, we need to be owner-insensitive. diff --git a/code/modules/mob/living/carbon/carbon_life.dm b/code/modules/mob/living/carbon/carbon_life.dm index d35e5bd81a8..07445456db5 100644 --- a/code/modules/mob/living/carbon/carbon_life.dm +++ b/code/modules/mob/living/carbon/carbon_life.dm @@ -1,6 +1,9 @@ /mob/living/carbon/Life(seconds, times_fired) set invisibility = 0 + if(flags & ABSTRACT) + return + if(notransform) return diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm index 2d0184095b6..214ca51752d 100644 --- a/code/modules/mob/living/carbon/carbon_procs.dm +++ b/code/modules/mob/living/carbon/carbon_procs.dm @@ -1,7 +1,7 @@ /mob/living/carbon/Initialize(mapload) . = ..() GLOB.carbon_list += src - if(!loc) + if(!loc && !(flags & ABSTRACT)) stack_trace("Carbon mob being instantiated in nullspace") /mob/living/carbon/Destroy() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index e8933a1e853..2762d3e63cf 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -107,3 +107,6 @@ /// Lazylist of sources to track what our alpha should be, alpha is set to the minimum. Use the `set_alpha_tracking` and `get_alpha` helpers. var/list/alpha_sources + +/mob/living/carbon/human/fake + flags = ABSTRACT