diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm index dfa930f7a76..a83ef71ddc6 100644 --- a/code/__DEFINES/vv.dm +++ b/code/__DEFINES/vv.dm @@ -136,6 +136,7 @@ // /mob/living #define VV_HK_GIVE_SPEECH_IMPEDIMENT "impede_speech" +#define VV_HK_ADMIN_RENAME "admin_rename" #define VV_HK_ADD_MOOD "addmood" #define VV_HK_REMOVE_MOOD "removemood" #define VV_HK_GIVE_HALLUCINATION "give_hallucination" diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 0f344be163f..0d935fbe94b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -2009,6 +2009,7 @@ GLOBAL_LIST_EMPTY(fire_appearances) VV_DROPDOWN_OPTION(VV_HK_GIVE_HALLUCINATION, "Give Hallucination") VV_DROPDOWN_OPTION(VV_HK_GIVE_DELUSION_HALLUCINATION, "Give Delusion Hallucination") VV_DROPDOWN_OPTION(VV_HK_GIVE_GUARDIAN_SPIRIT, "Give Guardian Spirit") + VV_DROPDOWN_OPTION(VV_HK_ADMIN_RENAME, "Force Change Name") /mob/living/vv_do_topic(list/href_list) . = ..() @@ -2046,6 +2047,29 @@ GLOBAL_LIST_EMPTY(fire_appearances) return admin_give_guardian(usr) + if(href_list[VV_HK_ADMIN_RENAME]) + if(!check_rights(R_ADMIN)) + return + + var/old_name = real_name + var/new_name = sanitize_name(tgui_input_text(usr, "Enter the new name.", "Admin Rename", real_name)) + if(!new_name || new_name == real_name) + return + + fully_replace_character_name(real_name, new_name) + var/replace_preferences = !isnull(client) && (tgui_alert(usr, "Would you like to update the client's preference with the new name?", "Pref Overwrite", list("Yes", "No")) == "Yes") + if(replace_preferences) + client.prefs.write_preference(GLOB.preference_entries[/datum/preference/name/real_name], new_name) + + log_admin("forced rename", list( + "admin" = key_name(usr), + "player" = key_name(src), + "old_name" = old_name, + "new_name" = new_name, + "updated_prefs" = replace_preferences, + )) + message_admins("[key_name_admin(usr)] has forcibly changed the real name of [key_name(src)] from '[old_name]' to '[real_name]'[(replace_preferences ? " and their preferences" : "")]") + /mob/living/proc/move_to_error_room() var/obj/effect/landmark/error/error_landmark = locate(/obj/effect/landmark/error) in GLOB.landmarks_list if(error_landmark)