From ba2720a2314c8dd77236107a89cb9f280707ba1f Mon Sep 17 00:00:00 2001 From: Charlie Nolan Date: Mon, 18 Mar 2024 11:44:25 -0700 Subject: [PATCH] Fixed clown and mime brain/head naming. (#24668) --- code/modules/mob/living/carbon/carbon_procs.dm | 9 +++++++++ code/modules/mob/living/carbon/human/human_organs.dm | 9 +++++++++ code/modules/mob/new_player/new_player.dm | 7 ++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm index 83698096cec..1ffd7524795 100644 --- a/code/modules/mob/living/carbon/carbon_procs.dm +++ b/code/modules/mob/living/carbon/carbon_procs.dm @@ -1383,3 +1383,12 @@ so that different stomachs can handle things in different ways VB*/ // keep most of what's passed in, but don't change the angle . = ..(target_turf, crush_damage, should_crit, crit_damage_factor, forced_crit, weaken_time, knockdown_time, should_rotate = FALSE, rightable = FALSE) KnockDown(10 SECONDS) + +/mob/living/carbon/rename_character(oldname, newname) + . = ..() + if(!.) + return + + for(var/obj/item/organ/internal/IO in internal_organs) + if(IO.dna?.real_name == oldname) + IO.dna.real_name = newname diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index f1cbef6f4ad..9584796cd3a 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -175,3 +175,12 @@ old_ue: Set this to a UE string, and this proc will overwrite the dna of organs for(var/obj/item/organ/external/limb in bodyparts) if(limb.status & ORGAN_SPLINTED) splinted_limbs += limb + +/mob/living/carbon/human/rename_character(oldname, newname) + . = ..() + if(!.) + return + + for(var/obj/item/organ/external/BP in bodyparts) + if(BP.dna?.real_name == oldname) + BP.dna.real_name = newname diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 05fe123b48d..839e3a44d37 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -551,11 +551,12 @@ if(mind) mind.active = FALSE //we wish to transfer the key manually - if(mind.assigned_role == "Clown") //give them a clownname if they are a clown - new_character.real_name = pick(GLOB.clown_names) //I hate this being here of all places but unfortunately dna is based on real_name! + // Clowns and mimes get appropriate default names, and the chance to pick a custom one. + if(mind.assigned_role == "Clown") + new_character.rename_character(new_character.real_name, pick(GLOB.clown_names)) new_character.rename_self("clown") else if(mind.assigned_role == "Mime") - new_character.real_name = pick(GLOB.mime_names) + new_character.rename_character(new_character.real_name, pick(GLOB.mime_names)) new_character.rename_self("mime") mind.set_original_mob(new_character) mind.transfer_to(new_character) //won't transfer key since the mind is not active