From c4a33ee9ad3efe1adb2187040b77c78fcf76eae2 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 29 May 2025 16:30:13 -0700 Subject: [PATCH] [MIRROR] Admin Respawn Respects Record Button Selection (#10975) Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: ShadowLarkens --- code/modules/admin/verbs/randomverbs.dm | 13 +++++++++++++ .../client/preference_setup/general/11_misc.dm | 8 +++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 1bcac7f914..cd4222a82b 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -519,8 +519,21 @@ Traitors and the like can also be revived with the previous role mostly intact. to_chat(src, "Something went wrong and spawning failed.") return + // Respect admin spawn record choice. There's really not a nice way to do this without butchering copy_to() code for an admin proc + var/old_mind_scan = picked_client.prefs.resleeve_scan + var/old_body_scan = picked_client.prefs.mind_scan + if(!records) // Make em false for the copy_to() + picked_client.prefs.resleeve_scan = FALSE + picked_client.prefs.mind_scan = FALSE + //Write the appearance and whatnot out to the character picked_client.prefs.copy_to(new_character) + + // Restore pref state + picked_client.prefs.resleeve_scan = old_mind_scan + picked_client.prefs.mind_scan = old_body_scan + + //Write the appearance and whatnot out to the character if(new_character.dna) new_character.dna.ResetUIFrom(new_character) new_character.sync_dna_traits(TRUE) // Traitgenes Sync traits to genetics if needed diff --git a/code/modules/client/preference_setup/general/11_misc.dm b/code/modules/client/preference_setup/general/11_misc.dm index a0732df3c9..fbe8dbf1ae 100644 --- a/code/modules/client/preference_setup/general/11_misc.dm +++ b/code/modules/client/preference_setup/general/11_misc.dm @@ -92,15 +92,17 @@ if(character && !istype(character,/mob/living/carbon/human/dummy)) character.vantag_pref = pref.vantag_preference BITSET(character.hud_updateflag, VANTAG_HUD) + var/want_body_save = pref.resleeve_scan + var/want_mind_save = pref.mind_scan spawn(50) if(QDELETED(character) || QDELETED(pref)) return // They might have been deleted during the wait if(!character.virtual_reality_mob && !(/mob/living/carbon/human/proc/perform_exit_vr in character.verbs)) //Janky fix to prevent resleeving VR avatars but beats refactoring transcore - if(pref.resleeve_scan) + if(want_body_save) var/datum/transhuman/body_record/BR = new() - BR.init_from_mob(character, pref.resleeve_scan, pref.resleeve_lock) - if(pref.mind_scan) + BR.init_from_mob(character, TRUE, pref.resleeve_lock) + if(want_mind_save) var/datum/transcore_db/our_db = SStranscore.db_by_key(null) if(our_db) our_db.m_backup(character.mind,character.nif,one_time = TRUE)