From 311c0117c10b98d8974178f8dfd498b768eaa467 Mon Sep 17 00:00:00 2001 From: Aura Dusklight <46622484+NovaDusklight@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:34:04 +0200 Subject: [PATCH] Conversion of realname and nickname from bay (#19120) * Automatic changelog compile [ci skip] * replace all bay instances for realname and nickname with tg * add comments where uncertain of sanitisation needed * Fix issue from git conflict.. * Fix issue causing setup menu not opening * Attempt to clean up how name datums are handled * Remove redundant check * Fix number issues with character names --------- Co-authored-by: vorestation-ci[bot] <199609141+vorestation-ci[bot]@users.noreply.github.com> --- code/_onclick/hud/ghost.dm | 2 +- code/datums/components/species/xenochimera.dm | 2 +- code/datums/ghost_spawn.dm | 2 +- code/game/birthday.dm | 2 +- code/game/jobs/job_controller.dm | 20 ++-- code/game/machinery/protean_reconstitutor.dm | 2 +- .../items/devices/communicator/UI_tgui.dm | 6 +- .../devices/communicator/communicator.dm | 2 +- .../items/devices/communicator/messaging.dm | 2 +- .../items/devices/communicator/phone.dm | 5 +- code/modules/admin/verbs/randomverbs.dm | 5 +- code/modules/admin/verbs/randomverbs_vr.dm | 5 +- .../preference_setup/general/01_basic.dm | 44 ++++----- .../preference_setup/general/02_language.dm | 9 +- .../preference_setup/general/03_body.dm | 9 +- .../preference_setup/general/11_misc.dm | 12 ++- .../client/preference_setup/general/13_nif.dm | 5 +- .../preference_setup/loadout/02_loadout.dm | 2 +- code/modules/client/preferences.dm | 24 ++--- code/modules/client/preferences/names.dm | 94 +++++++++++++++++++ code/modules/mob/living/living_vr.dm | 4 +- code/modules/mob/living/voice/voice.dm | 4 +- code/modules/mob/new_player/lobby_browser.dm | 4 +- code/modules/mob/new_player/new_player.dm | 2 +- code/modules/mob/new_player/new_player_vr.dm | 2 +- code/modules/organs/organ.dm | 2 +- code/modules/organs/organ_external.dm | 2 +- code/modules/resleeving/autoresleever.dm | 2 +- code/modules/tgui/modules/late_choices.dm | 2 +- code/modules/vore/eating/inbelly_spawn.dm | 5 +- code/modules/vore/eating/vorepanel_vr.dm | 2 +- code/modules/vore/persist/persist_vr.dm | 5 +- vorestation.dme | 1 + 33 files changed, 201 insertions(+), 90 deletions(-) create mode 100644 code/modules/client/preferences/names.dm diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index 3d81ecadfe..ae2628b450 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -101,7 +101,7 @@ ..() var/mob/observer/dead/G = usr var/datum/data/record/record_found - record_found = find_general_record("name", G.client.prefs.real_name) + record_found = find_general_record("name", G.client.prefs.read_preference(/datum/preference/name/real_name)) // Found their record, they were spawned previously. Remind them corpses cannot play games. if(record_found) var/answer = tgui_alert(G, "You seem to have previously joined this round. If you are currently dead, you should not enter VR as this character. Would you still like to proceed?", "Previously spawned",list("Yes", "No")) diff --git a/code/datums/components/species/xenochimera.dm b/code/datums/components/species/xenochimera.dm index ea8a80a90d..ef6c12b232 100644 --- a/code/datums/components/species/xenochimera.dm +++ b/code/datums/components/species/xenochimera.dm @@ -401,7 +401,7 @@ if(slot_is_synth && !isSynthetic()) // Prevents some pretty weird situations to_chat(src,span_warning("Cannot apply character appearance. [slot_is_synth ? "The slot's character is synthetic." : "The slot's character is organic."] Slot must match the current body's synthetic state. Please try another character.")) return - from_slot = "You'll hatch using [client.prefs.real_name]'s appearance" + from_slot = "You'll hatch using [client.prefs.read_preference(/datum/preference/name/real_name)]'s appearance" var/confirm = tgui_alert(src, "Are you sure you want to hatch right now? This will be very obvious to anyone in view. [from_slot]! Are you sure?", "Confirm Regeneration", list("Yes", "No")) if(confirm == "Yes") diff --git a/code/datums/ghost_spawn.dm b/code/datums/ghost_spawn.dm index 801adab04c..4fe287bed1 100644 --- a/code/datums/ghost_spawn.dm +++ b/code/datums/ghost_spawn.dm @@ -175,7 +175,7 @@ GLOBAL_VAR_INIT(allowed_ghost_spawns, 2) ) /datum/tgui_module/ghost_spawn_menu/proc/get_vr_data(mob/user) - var/datum/data/record/record_found = find_general_record("name", user.client.prefs.real_name) + var/datum/data/record/record_found = find_general_record("name", user.client.prefs.read_preference(/datum/preference/name/real_name)) var/list/vr_landmarks = list() for(var/obj/effect/landmark/virtual_reality/sloc in GLOB.landmarks_list) vr_landmarks += list(REF(sloc) = sloc.name) diff --git a/code/game/birthday.dm b/code/game/birthday.dm index ccbc788f07..e5590bd1a3 100644 --- a/code/game/birthday.dm +++ b/code/game/birthday.dm @@ -3,7 +3,7 @@ var/bday_day = read_preference(/datum/preference/numeric/human/bday_day) if(!bday_month || !bday_day) //If we don't have one of these set, don't worry about it return - if(real_name != client.prefs.real_name) //let's not celebrate the birthday of that weird mob we got dropped into + if(real_name != client.prefs.read_preference(/datum/preference/name/real_name)) //let's not celebrate the birthday of that weird mob we got dropped into return if(!(read_preference(/datum/preference/numeric/human/last_bday_note) < GLOB.world_time_year)) //you only get notified once a year diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 7894ca2055..fa7f81ff62 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -725,19 +725,20 @@ GLOBAL_DATUM(job_master, /datum/controller/occupations) message_admins("[key_name(C)] has requested to vore spawn into [key_name(pred)]") var/confirm + var/spawner_name = C.prefs.read_preference(/datum/preference/name/real_name) if(pred.no_latejoin_vore_warning) if(pred.no_latejoin_vore_warning_time > 0) if(absorb_choice) - confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS) + confirm = tgui_alert(pred, "[spawner_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS) else - confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS) + confirm = tgui_alert(pred, "[spawner_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), pred.no_latejoin_vore_warning_time SECONDS) if(!confirm) confirm = "Yes" else if(absorb_choice) - confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) + confirm = tgui_alert(pred, "[spawner_name] is attempting to spawn absorbed as your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) else - confirm = tgui_alert(pred, "[C.prefs.real_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) + confirm = tgui_alert(pred, "[spawner_name] is attempting to spawn into your [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) if(confirm != "Yes") to_chat(C, span_warning("[pred] has declined your spawn request.")) var/message = tgui_input_text(pred,"Do you want to leave them a message?", "Notify Prey", max_length = MAX_MESSAGE_LEN) @@ -802,19 +803,20 @@ GLOBAL_DATUM(job_master, /datum/controller/occupations) message_admins("[key_name(C)] has requested to pred spawn onto [key_name(prey)]") var/confirm + var/spawner_name = C.prefs.read_preference(/datum/preference/name/real_name) if(prey.no_latejoin_prey_warning) if(prey.no_latejoin_prey_warning_time > 0) if(absorb_choice) - confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS) + confirm = tgui_alert(prey, "[spawner_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS) else - confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS) + confirm = tgui_alert(prey, "[spawner_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes"), prey.no_latejoin_prey_warning_time SECONDS) if(!confirm) confirm = "Yes" else if(absorb_choice) - confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) + confirm = tgui_alert(prey, "[spawner_name] is attempting to televore and instantly absorb you with their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) else - confirm = tgui_alert(prey, "[C.prefs.real_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) + confirm = tgui_alert(prey, "[spawner_name] is attempting to televore you into their [vore_spawn_gut]. Let them?", "Confirm", list("No", "Yes")) if(confirm != "Yes") to_chat(C, span_warning("[prey] has declined your spawn request.")) var/message = tgui_input_text(prey,"Do you want to leave them a message?", "Notify Pred", max_length = MAX_MESSAGE_LEN) @@ -898,7 +900,7 @@ GLOBAL_DATUM(job_master, /datum/controller/occupations) to_chat(C, span_boldwarning("[carrier] has received your spawn request. Please wait.")) log_and_message_admins("[key_name(C)] has requested to item spawn into [key_name(carrier)]'s possession") - var/confirm = tgui_alert(carrier, "[C.prefs.real_name] is attempting to join as the [item_name] in your possession.", "Confirm", list("No", "Yes")) + var/confirm = tgui_alert(carrier, "[C.prefs.read_preference(/datum/preference/name/real_name)] is attempting to join as the [item_name] in your possession.", "Confirm", list("No", "Yes")) if(confirm != "Yes") to_chat(C, span_warning("[carrier] has declined your spawn request.")) var/message = tgui_input_text(carrier,"Do you want to leave them a message?", "Notify Spawner", max_length = MAX_MESSAGE_LEN) diff --git a/code/game/machinery/protean_reconstitutor.dm b/code/game/machinery/protean_reconstitutor.dm index 61b55c0157..0264a77366 100644 --- a/code/game/machinery/protean_reconstitutor.dm +++ b/code/game/machinery/protean_reconstitutor.dm @@ -235,7 +235,7 @@ var/picked_slot = posibrain_client.prefs.default_slot var/charjob var/datum/data/record/record_found - record_found = find_general_record("name",posibrain_client.prefs.real_name) + record_found = find_general_record("name", posibrain_client.prefs.read_preference(/datum/preference/name/real_name)) if(record_found) charjob = record_found.fields["real_rank"] else diff --git a/code/game/objects/items/devices/communicator/UI_tgui.dm b/code/game/objects/items/devices/communicator/UI_tgui.dm index 1d56e7c416..f1f091afcc 100644 --- a/code/game/objects/items/devices/communicator/UI_tgui.dm +++ b/code/game/objects/items/devices/communicator/UI_tgui.dm @@ -155,7 +155,7 @@ for(var/mob/observer/dead/O in known_devices) if(O.client && O.client.prefs.communicator_visibility == 1 && O.exonet) communicators.Add(list(list( - "name" = sanitize("[O.client.prefs.real_name]'s communicator"), + "name" = sanitize("[O.client.prefs.read_preference(/datum/preference/name/real_name)]'s communicator"), "address" = O.exonet.address, "ref" = "\ref[O]" ))) @@ -173,7 +173,7 @@ for(var/mob/observer/dead/O in voice_invites) if(O.exonet && O.client) invites.Add(list(list( - "name" = sanitize("[O.client.prefs.real_name]'s communicator"), + "name" = sanitize("[O.client.prefs.read_preference(/datum/preference/name/real_name)]'s communicator"), "address" = O.exonet.address, "ref" = "\ref[O]" ))) @@ -191,7 +191,7 @@ for(var/mob/observer/dead/O in voice_requests) if(O.exonet && O.client) requests.Add(list(list( - "name" = sanitize("[O.client.prefs.real_name]'s communicator"), + "name" = sanitize("[O.client.prefs.read_preference(/datum/preference/name/real_name)]'s communicator"), "address" = O.exonet.address, "ref" = "\ref[O]" ))) diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index 54a356f766..7a3923675e 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -261,7 +261,7 @@ . = ..() exonet = new(src) if(client) - exonet.make_address("communicator-[src.client]-[src.client.prefs.real_name]") + exonet.make_address("communicator-[src.client]-[src.client.prefs.read_preference(/datum/preference/name/real_name)]") else exonet.make_address("communicator-[key]-[src.real_name]") diff --git a/code/game/objects/items/devices/communicator/messaging.dm b/code/game/objects/items/devices/communicator/messaging.dm index af5aad2cac..623a73a602 100644 --- a/code/game/objects/items/devices/communicator/messaging.dm +++ b/code/game/objects/items/devices/communicator/messaging.dm @@ -129,7 +129,7 @@ return //something is terribly wrong for(var/mob/living/L in GLOB.mob_list) //Simple check so you don't have dead people calling. - if(src.client.prefs.real_name == L.real_name) + if(src.client.prefs.read_preference(/datum/preference/name/real_name) == L.real_name) to_chat(src, span_danger("Your identity is already present in the game world. Please load in a different character first.")) return diff --git a/code/game/objects/items/devices/communicator/phone.dm b/code/game/objects/items/devices/communicator/phone.dm index f7938facc3..68260d6cc8 100644 --- a/code/game/objects/items/devices/communicator/phone.dm +++ b/code/game/objects/items/devices/communicator/phone.dm @@ -286,7 +286,8 @@ if (usr != src) return //something is terribly wrong - var/confirm = tgui_alert(src, "Would you like to talk as [src.client.prefs.real_name], over a communicator? This will reset your respawn timer, if someone answers.", "Join as Voice?", list("Yes","No")) + var/prefs_name = src.client.prefs.read_preference(/datum/preference/name/real_name) + var/confirm = tgui_alert(src, "Would you like to talk as [prefs_name], over a communicator? This will reset your respawn timer, if someone answers.", "Join as Voice?", list("Yes","No")) if(confirm != "Yes") return @@ -295,7 +296,7 @@ return for(var/mob/living/L in GLOB.mob_list) //Simple check so you don't have dead people calling. - if(src.client.prefs.real_name == L.real_name) + if(prefs_name == L.real_name) to_chat(src, span_danger("Your identity is already present in the game world. Please load in a different character first.")) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 85a38d6365..1b833201db 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -419,11 +419,12 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp var/charjob var/records var/datum/data/record/record_found - record_found = find_general_record("name",picked_client.prefs.real_name) + var/char_real_name = picked_client.prefs.read_preference(/datum/preference/name/real_name) + record_found = find_general_record("name", char_real_name) //Found their record, they were spawned previously if(record_found) - var/samejob = tgui_alert(src,"Found [picked_client.prefs.real_name] in data core. They were [record_found.fields["real_rank"]] this round. Assign same job? They will not be re-added to the manifest/records, either way.","Previously spawned",list("Yes","Assistant","No")) + var/samejob = tgui_alert(src,"Found [char_real_name] in data core. They were [record_found.fields["real_rank"]] this round. Assign same job? They will not be re-added to the manifest/records, either way.","Previously spawned",list("Yes","Assistant","No")) if(!samejob) return if(samejob == "Yes") diff --git a/code/modules/admin/verbs/randomverbs_vr.dm b/code/modules/admin/verbs/randomverbs_vr.dm index 00bc28505d..7442cfa78a 100644 --- a/code/modules/admin/verbs/randomverbs_vr.dm +++ b/code/modules/admin/verbs/randomverbs_vr.dm @@ -58,8 +58,9 @@ new_mob.ai_holder_type = /datum/ai_holder/simple_mob/inert //Dont want the mob AI to activate if the client dc's or anything if(name) - new_mob.real_name = picked_client.prefs.real_name - new_mob.name = picked_client.prefs.real_name + var/spawner_name = picked_client.prefs.read_preference(/datum/preference/name/real_name) + new_mob.real_name = spawner_name + new_mob.name = spawner_name new_mob.key = picked_client.key //Finally put them in the mob diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm index 1cda69bb14..66253cf0c0 100644 --- a/code/modules/client/preference_setup/general/01_basic.dm +++ b/code/modules/client/preference_setup/general/01_basic.dm @@ -18,16 +18,12 @@ sort_order = 1 /datum/category_item/player_setup_item/general/basic/load_character(list/save_data) - pref.real_name = save_data["real_name"] - pref.nickname = save_data["nickname"] pref.biological_gender = save_data["gender"] pref.identifying_gender = save_data["id_gender"] pref.vore_egg_type = save_data["vore_egg_type"] pref.autohiss = save_data["autohiss"] /datum/category_item/player_setup_item/general/basic/save_character(list/save_data) - save_data["real_name"] = pref.real_name - save_data["nickname"] = pref.nickname save_data["gender"] = pref.biological_gender save_data["id_gender"] = pref.identifying_gender save_data["vore_egg_type"] = pref.vore_egg_type @@ -36,29 +32,31 @@ /datum/category_item/player_setup_item/general/basic/sanitize_character() pref.biological_gender = sanitize_inlist(pref.biological_gender, get_genders(), pick(get_genders())) pref.identifying_gender = (pref.identifying_gender in all_genders_define_list) ? pref.identifying_gender : pref.biological_gender - pref.real_name = sanitize_name(pref.real_name, pref.species, is_FBP()) - if(!pref.real_name) - pref.real_name = random_name(pref.identifying_gender, pref.species) - pref.nickname = sanitize_name(pref.nickname) pref.vore_egg_type = sanitize_inlist(pref.vore_egg_type, GLOB.global_vore_egg_types, initial(pref.vore_egg_type)) pref.autohiss = sanitize_inlist(pref.autohiss, list("Off", "Basic", "Full"), initial(pref.autohiss)) // Moved from /datum/preferences/proc/copy_to() /datum/category_item/player_setup_item/general/basic/copy_to_mob(var/mob/living/carbon/human/character) + var/char_real_name = pref.read_preference(/datum/preference/name/real_name) + // Re-sanitize name on join. + // Fixes being able to swap from FBP to organic before round join to be organic with numbers in name. + char_real_name = sanitize_name(char_real_name, pref.species, is_FBP()) + if(!char_real_name) + char_real_name = random_name(pref.identifying_gender, pref.species) if(CONFIG_GET(flag/humans_need_surnames)) - var/firstspace = findtext(pref.real_name, " ") - var/name_length = length(pref.real_name) + var/firstspace = findtext(char_real_name, " ") + var/name_length = length(char_real_name) if(!firstspace) //we need a surname - pref.real_name += " [pick(GLOB.last_names)]" + char_real_name += " [pick(GLOB.last_names)]" else if(firstspace == name_length) - pref.real_name += "[pick(GLOB.last_names)]" + char_real_name += "[pick(GLOB.last_names)]" - character.real_name = pref.real_name + character.real_name = char_real_name character.name = character.real_name if(character.dna) character.dna.real_name = character.real_name - character.nickname = pref.nickname + character.nickname = pref.read_preference(/datum/preference/name/nickname) character.gender = pref.biological_gender character.identifying_gender = pref.identifying_gender @@ -80,9 +78,9 @@ /datum/category_item/player_setup_item/general/basic/tgui_data(mob/user) var/list/data = ..() - data["real_name"] = pref.real_name + data["real_name"] = pref.read_preference(/datum/preference/name/real_name) data["be_random_name"] = pref.read_preference(/datum/preference/toggle/human/name_is_always_random) - data["nickname"] = pref.nickname + data["nickname"] = pref.read_preference(/datum/preference/name/nickname) data["biological_sex"] = gender2text(pref.biological_gender) data["identifying_gender"] = gender2text(pref.identifying_gender) data["age"] = pref.read_preference(/datum/preference/numeric/human/age) @@ -201,18 +199,19 @@ switch(action) if("rename") - var/raw_name = tgui_input_text(user, "Choose your character's name:", "Character Name", pref.real_name, encode = FALSE) + var/current_name = pref.read_preference(/datum/preference/name/real_name) + var/raw_name = tgui_input_text(user, "Choose your character's name:", "Character Name", current_name, encode = FALSE) if(!isnull(raw_name)) var/new_name = sanitize_name(raw_name, pref.species, is_FBP()) if(new_name) - pref.real_name = new_name + pref.update_preference_by_type(/datum/preference/name/real_name, new_name) return TOPIC_REFRESH else to_chat(user, span_warning("Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .")) return TOPIC_NOACTION if("random_name") - pref.real_name = random_name(pref.identifying_gender, pref.species) + pref.update_preference_by_type(/datum/preference/name/real_name, random_name(pref.identifying_gender, pref.species)) return TOPIC_REFRESH if("always_random_name") @@ -220,11 +219,12 @@ return TOPIC_REFRESH if("nickname") - var/raw_nickname = tgui_input_text(user, "Choose your character's nickname:", "Character Nickname", pref.nickname, encode = FALSE) + var/current_nickname = pref.read_preference(/datum/preference/name/nickname) + var/raw_nickname = tgui_input_text(user, "Choose your character's nickname:", "Character Nickname", current_nickname, encode = FALSE) if(!isnull(raw_nickname)) var/new_nickname = sanitize_name(raw_nickname, pref.species, is_FBP()) if(new_nickname) - pref.nickname = new_nickname + pref.update_preference_by_type(/datum/preference/name/nickname, new_nickname) return TOPIC_REFRESH else to_chat(user, span_warning("Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .")) @@ -233,7 +233,7 @@ if("reset_nickname") var/nick_choice = tgui_alert(user, "Wipe your Nickname? This will completely remove any chosen nickname(s).","Wipe Nickname",list("Yes","No")) if(nick_choice == "Yes") - pref.nickname = null + pref.update_preference_by_type(/datum/preference/name/nickname, null) return TOPIC_REFRESH if("bio_gender") diff --git a/code/modules/client/preference_setup/general/02_language.dm b/code/modules/client/preference_setup/general/02_language.dm index c2fc93bcf3..4d7aa5e74c 100644 --- a/code/modules/client/preference_setup/general/02_language.dm +++ b/code/modules/client/preference_setup/general/02_language.dm @@ -26,17 +26,18 @@ save_data["runechat_color"] = pref.runechat_color /datum/category_item/player_setup_item/general/language/sanitize_character() + var/char_name = pref.read_preference(/datum/preference/name/real_name) || "-name not yet loaded-" if(!islist(pref.alternate_languages)) - testing("LANGSANI: Sanitizing languages on [pref.client]'s character [pref.real_name || "-name not yet loaded-"] because their character has no languages list") + testing("LANGSANI: Sanitizing languages on [pref.client]'s character [char_name] because their character has no languages list") pref.alternate_languages = list() if(pref.species) var/datum/species/S = GLOB.all_species[pref.species] if(!istype(S)) - testing("LANGSANI: Failed sani on [pref.client]'s character [pref.real_name || "-name not yet loaded-"] because their species ([pref.species]) isn't in the global list") + testing("LANGSANI: Failed sani on [pref.client]'s character [char_name] because their species ([pref.species]) isn't in the global list") return if(pref.alternate_languages.len > (S.num_alternate_languages + pref.extra_languages)) - testing("LANGSANI: Truncated [pref.client]'s character [pref.real_name || "-name not yet loaded-"] language list because it was too long (len: [pref.alternate_languages.len], allowed: [S.num_alternate_languages])") + testing("LANGSANI: Truncated [pref.client]'s character [char_name] language list because it was too long (len: [pref.alternate_languages.len], allowed: [S.num_alternate_languages])") pref.alternate_languages.len = (S.num_alternate_languages + pref.extra_languages) // Truncate to allowed length // VOREStation Edit Start @@ -48,7 +49,7 @@ for(var/language in pref.alternate_languages) var/datum/language/L = GLOB.all_languages[language] if(!istype(L) || (L.flags & RESTRICTED) || (!(language in S.secondary_langs) && pref.client && !is_lang_whitelisted(pref.client, L))) - testing("LANGSANI: Removed [L?.name || "lang not found"] from [pref.client]'s character [pref.real_name || "-name not yet loaded-"] because it failed allowed checks") + testing("LANGSANI: Removed [L?.name || "lang not found"] from [pref.client]'s character [char_name] because it failed allowed checks") pref.alternate_languages -= language if(isnull(pref.language_prefixes) || !pref.language_prefixes.len) diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index fbacb03ff9..2c668d746d 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -267,9 +267,12 @@ pref.rlimb_data -= null // Sanitize the name so that there aren't any numbers sticking around. - pref.real_name = sanitize_name(pref.real_name, pref.species) - if(!pref.real_name) - pref.real_name = random_name(pref.identifying_gender, pref.species) + // Is this still necessary with TG conversation? + var/current_name = pref.read_preference(/datum/preference/name/real_name) + current_name = sanitize_name(current_name, pref.species) + if(!current_name) + current_name = random_name(pref.identifying_gender, pref.species) + pref.update_preference_by_type(/datum/preference/name/real_name, current_name) /datum/category_item/player_setup_item/general/body/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) var/list/data = ..() diff --git a/code/modules/client/preference_setup/general/11_misc.dm b/code/modules/client/preference_setup/general/11_misc.dm index 1adad032c6..0119c5f682 100644 --- a/code/modules/client/preference_setup/general/11_misc.dm +++ b/code/modules/client/preference_setup/general/11_misc.dm @@ -252,22 +252,26 @@ pref.vantag_preference = names_list[selection] return TOPIC_REFRESH if("custom_say") - var/say_choice = tgui_input_text(user, "This word or phrase will appear instead of 'says': [pref.real_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12) + var/char_name = pref.read_preference(/datum/preference/name/real_name) + var/say_choice = tgui_input_text(user, "This word or phrase will appear instead of 'says': [char_name] says, \"Hi.\"", "Custom Say", pref.custom_say, 12) if(say_choice) pref.custom_say = say_choice return TOPIC_REFRESH if("custom_whisper") - var/whisper_choice = tgui_input_text(user, "This word or phrase will appear instead of 'whispers': [pref.real_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12) + var/char_name = pref.read_preference(/datum/preference/name/real_name) + var/whisper_choice = tgui_input_text(user, "This word or phrase will appear instead of 'whispers': [char_name] whispers, \"Hi...\"", "Custom Whisper", pref.custom_whisper, 12) if(whisper_choice) pref.custom_whisper = whisper_choice return TOPIC_REFRESH if("custom_ask") - var/ask_choice = tgui_input_text(user, "This word or phrase will appear instead of 'asks': [pref.real_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12) + var/char_name = pref.read_preference(/datum/preference/name/real_name) + var/ask_choice = tgui_input_text(user, "This word or phrase will appear instead of 'asks': [char_name] asks, \"Hi?\"", "Custom Ask", pref.custom_ask, 12) if(ask_choice) pref.custom_ask = ask_choice return TOPIC_REFRESH if("custom_exclaim") - var/exclaim_choice = tgui_input_text(user, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [pref.real_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12) + var/char_name = pref.read_preference(/datum/preference/name/real_name) + var/exclaim_choice = tgui_input_text(user, "This word or phrase will appear instead of 'exclaims', 'shouts' or 'yells': [char_name] exclaims, \"Hi!\"", "Custom Exclaim", pref.custom_exclaim, 12) if(exclaim_choice) pref.custom_exclaim = exclaim_choice return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/general/13_nif.dm b/code/modules/client/preference_setup/general/13_nif.dm index 6d42257812..91f59dfbc1 100644 --- a/code/modules/client/preference_setup/general/13_nif.dm +++ b/code/modules/client/preference_setup/general/13_nif.dm @@ -35,18 +35,19 @@ savefile.save() /datum/category_item/player_setup_item/general/nif/sanitize_character() + var/char_name = pref.read_preference(/datum/preference/name/real_name) || "-name not yet loaded-" if(pref.nif_path && !ispath(pref.nif_path)) //We have at least a text string that should be a path. pref.nif_path = text2path(pref.nif_path) //Try to convert it to a hard path. if(!pref.nif_path) //If we couldn't, kill it. pref.nif_path = null //Kill! - WARNING("Loaded a NIF but it was an invalid path, [pref.real_name]") + WARNING("Loaded a NIF but it was an invalid path, [char_name]") if (ispath(pref.nif_path, /obj/item/nif/protean) && pref.species != SPECIES_PROTEAN) //no free nifs pref.nif_path = null if(ispath(pref.nif_path) && isnull(pref.nif_durability)) //How'd you lose this? pref.nif_durability = initial(pref.nif_path.durability) //Well, have a new one, my bad. - WARNING("Loaded a NIF but with no durability, [pref.real_name]") + WARNING("Loaded a NIF but with no durability, [char_name]") if(!islist(pref.nif_savedata)) pref.nif_savedata = list() diff --git a/code/modules/client/preference_setup/loadout/02_loadout.dm b/code/modules/client/preference_setup/loadout/02_loadout.dm index 95d4dd1469..15d772fc52 100644 --- a/code/modules/client/preference_setup/loadout/02_loadout.dm +++ b/code/modules/client/preference_setup/loadout/02_loadout.dm @@ -80,7 +80,7 @@ var/list/gear_datums = list() if(pref.client) if(G.ckeywhitelist && !(pref.client_ckey in G.ckeywhitelist)) return FALSE - if(G.character_name && !(pref.real_name in G.character_name)) + if(G.character_name && !(pref.read_preference(/datum/preference/name/real_name) in G.character_name)) return FALSE return TRUE diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index cddffabe03..ba1bd51f80 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -19,8 +19,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/be_special = 0 //Special role selection //character preferences - var/real_name //our character's name - var/nickname //our character's nickname var/b_type = DEFAULT_BLOOD_TYPE //blood type (not-chooseable) var/blood_reagents = "default" //blood restoration reagents var/headset = 1 //headset type @@ -160,7 +158,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) // Didn't load a character, so let's randomize set_biological_gender(pick(MALE, FEMALE)) - real_name = random_name(identifying_gender,species) + update_preference_by_type(/datum/preference/name/real_name, random_name(identifying_gender, species)) b_type = RANDOM_BLOOD_TYPE if(client) @@ -177,7 +175,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) return ..() /datum/preferences/proc/ShowChoices(mob/user) - if(!user || !user.client) return + if(!user || !user.client) + return if(!get_mob_by_key(client_ckey)) to_chat(user, span_danger("No mob exists for the given client!")) @@ -260,7 +259,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(href_list["save"]) if(save_character()) - to_chat(usr,span_notice("Character [player_setup?.preferences?.real_name] saved!")) + to_chat(usr,span_notice("Character [player_setup?.preferences?.read_preference(/datum/preference/name/real_name)] saved!")) save_preferences() else if(href_list["reload"]) load_preferences(TRUE) @@ -301,7 +300,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.set_species(species) // Special Case: This references variables owned by two different datums, so do it here. if(read_preference(/datum/preference/toggle/human/name_is_always_random)) - real_name = random_name(identifying_gender,species) + update_preference_by_type(/datum/preference/name/real_name, random_name(identifying_gender, species)) // Ask the preferences datums to apply their own settings to the new mob player_setup.copy_to_mob(character) @@ -424,18 +423,19 @@ GLOBAL_LIST_EMPTY(preferences_datums) blood color */ if (copy_name) + var/char_real_name = read_preference(/datum/preference/name/real_name) if(CONFIG_GET(flag/humans_need_surnames)) - var/firstspace = findtext(real_name, " ") - var/name_length = length(real_name) + var/firstspace = findtext(char_real_name, " ") + var/name_length = length(char_real_name) if(!firstspace) //we need a surname - real_name += " [pick(GLOB.last_names)]" + char_real_name += " [pick(GLOB.last_names)]" else if(firstspace == name_length) - real_name += "[pick(GLOB.last_names)]" - character.real_name = real_name + char_real_name += "[pick(GLOB.last_names)]" + character.real_name = char_real_name character.name = character.real_name if(character.dna) character.dna.real_name = character.real_name - character.nickname = nickname + character.nickname = read_preference(/datum/preference/name/nickname) character.gender = biological_gender character.identifying_gender = identifying_gender diff --git a/code/modules/client/preferences/names.dm b/code/modules/client/preferences/names.dm new file mode 100644 index 0000000000..ba4711bab9 --- /dev/null +++ b/code/modules/client/preferences/names.dm @@ -0,0 +1,94 @@ +// Name preferences for character creation +// Handles name related validation, including per species. + +/// Abstract name preference type that provides species-aware sanitization +/datum/preference/name + abstract_type = /datum/preference/name + savefile_identifier = PREFERENCE_CHARACTER + priority = PREFERENCE_PRIORITY_NAMES + var/maximum_value_length = MAX_NAME_LEN + var/default_species = SPECIES_HUMAN + +/// Check if the character is a Full Body Prosthetic (allows numbers in name) +/datum/preference/name/proc/is_fbp(datum/preferences/preferences) + if(!preferences?.organ_data) + return FALSE + return preferences.organ_data[BP_TORSO] == "cyborg" + +/datum/preference/name/is_valid(value) + if(!istext(value)) + return FALSE + if(length(value) > maximum_value_length) + return FALSE + return TRUE + +/datum/preference/name/pref_deserialize(input, datum/preferences/preferences) + if(!istext(input)) + return create_default_value() + var/species = default_species + if(preferences?.species) + species = preferences.species + var/allow_numbers = is_fbp(preferences) + var/sanitized = sanitize_name(input, species, allow_numbers) + if(!sanitized) + return create_default_value() + return sanitized + +// Note: pref_serialize intentionally does NOT re-sanitize the value. +// The base proc doesn't pass preferences, so we can't check is_fbp(). +// Sanitization happens on read via pref_deserialize which DOES have access to preferences. +/datum/preference/name/pref_serialize(input) + if(!istext(input)) + return create_default_value() + return input + +/datum/preference/name/apply_to_human(mob/living/carbon/human/target, value) + return // Handled in copy_to_mob + +/datum/preference/name/apply_to_living(mob/living/target, value) + return + +/datum/preference/name/apply_to_silicon(mob/living/silicon/target, value) + return + +/datum/preference/name/apply_to_animal(mob/living/simple_mob, value) + return + +/// Character's real name +/datum/preference/name/real_name + savefile_key = "real_name" + +/datum/preference/name/real_name/create_default_value() + return "Character" + +/datum/preference/name/real_name/create_informed_default_value(datum/preferences/preferences) + var/gender = preferences?.identifying_gender || MALE + var/species = preferences?.species || SPECIES_HUMAN + return random_name(gender, species) + +/datum/preference/name/real_name/create_random_value(datum/preferences/preferences, datum/species/current_species) + var/gender = preferences?.identifying_gender || MALE + var/species_name = current_species?.name || SPECIES_HUMAN + return random_name(gender, species_name) + +/// Character's nickname (optional) +/datum/preference/name/nickname + savefile_key = "nickname" + +/datum/preference/name/nickname/is_valid(value) + if(isnull(value) || value == "") + return TRUE + return ..() + +/datum/preference/name/nickname/pref_deserialize(input, datum/preferences/preferences) + if(isnull(input) || input == "") + return null + return ..() + +/datum/preference/name/nickname/pref_serialize(value, datum/preferences/preferences) + if(isnull(value) || value == "") + return null + return ..() + +/datum/preference/name/nickname/create_default_value() + return null diff --git a/code/modules/mob/living/living_vr.dm b/code/modules/mob/living/living_vr.dm index 4e59625bdb..e7597c37a5 100644 --- a/code/modules/mob/living/living_vr.dm +++ b/code/modules/mob/living/living_vr.dm @@ -81,7 +81,7 @@ /mob/living/proc/save_ooc_panel(mob/user) if(user != src) return - if(client.prefs.real_name != real_name) + if(client.prefs.read_preference(/datum/preference/name/real_name) != real_name) to_chat(src, span_danger("Your selected character slot name is not the same as your character's name. Aborting save. Please select [real_name]'s character slot in character setup before saving.")) return if(client.prefs.save_character()) @@ -186,7 +186,7 @@ /mob/living/proc/save_private_notes(mob/user) if(user != src) return - if(client.prefs.real_name != real_name) + if(client.prefs.read_preference(/datum/preference/name/real_name) != real_name) to_chat(src, span_danger("Your selected character slot name is not the same as your character's name. Aborting save. Please select [real_name]'s character slot in character setup before saving.")) return if(client.prefs.save_character()) diff --git a/code/modules/mob/living/voice/voice.dm b/code/modules/mob/living/voice/voice.dm index 66d9295da3..5e1f5fd437 100644 --- a/code/modules/mob/living/voice/voice.dm +++ b/code/modules/mob/living/voice/voice.dm @@ -29,7 +29,7 @@ alpha = 127 //Maybe we'll have hologram calls later. if(speaker.client && speaker.client.prefs) var/datum/preferences/p = speaker.client.prefs - name = p.real_name + name = p.read_preference(/datum/preference/name/real_name) real_name = name gender = p.identifying_gender @@ -81,7 +81,7 @@ set desc = "Changes your name." set src = usr - var/new_name = sanitizeSafe(tgui_input_text(src, "Who would you like to be now?", "Communicator", src.client.prefs.real_name, MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN) + var/new_name = sanitizeSafe(tgui_input_text(src, "Who would you like to be now?", "Communicator", src.client.prefs.read_preference(/datum/preference/name/real_name), MAX_NAME_LEN, encode = FALSE), MAX_NAME_LEN) if(new_name) if(comm) comm.visible_message(span_notice("[icon2html(comm,viewers(comm))] [src.name] has left, and now you see [new_name].")) diff --git a/code/modules/mob/new_player/lobby_browser.dm b/code/modules/mob/new_player/lobby_browser.dm index c8e185c955..b4b0ce81df 100644 --- a/code/modules/mob/new_player/lobby_browser.dm +++ b/code/modules/mob/new_player/lobby_browser.dm @@ -128,8 +128,8 @@ announce_ghost_joinleave(src) if(client.prefs.read_preference(/datum/preference/toggle/human/name_is_always_random)) - client.prefs.real_name = random_name(client.prefs.identifying_gender) - observer.real_name = client.prefs.real_name + client.prefs.update_preference_by_type(/datum/preference/name/real_name, random_name(client.prefs.identifying_gender)) + observer.real_name = client.prefs.read_preference(/datum/preference/name/real_name) observer.name = observer.real_name if(!check_rights_for(client, R_HOLDER) && !CONFIG_GET(flag/antag_hud_allowed)) // For new ghosts we remove the verb from even showing up if it's not allowed. remove_verb(observer, /mob/observer/dead/verb/toggle_antagHUD) // Poor guys, don't know what they are missing! diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index a831709c60..d3769414b0 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -400,7 +400,7 @@ if(CONFIG_GET(flag/force_random_names)) new_character.gender = pick(MALE, FEMALE) - client.prefs.real_name = random_name(new_character.gender) + client.prefs.update_preference_by_type(/datum/preference/name/real_name, random_name(new_character.gender)) else client.prefs.copy_to(new_character, icon_updates = TRUE) diff --git a/code/modules/mob/new_player/new_player_vr.dm b/code/modules/mob/new_player/new_player_vr.dm index 312ab03456..594a108a70 100644 --- a/code/modules/mob/new_player/new_player_vr.dm +++ b/code/modules/mob/new_player/new_player_vr.dm @@ -17,7 +17,7 @@ pass = FALSE //Are they on the VERBOTEN LIST? - if (GLOB.prevent_respawns.Find(client?.prefs?.real_name)) + if (GLOB.prevent_respawns.Find(client?.prefs?.read_preference(/datum/preference/name/real_name))) to_chat(src,span_warning("You've already quit the round as this character. You can't go back now that you've free'd your job slot. Play another character, or wait for the next round.")) pass = FALSE diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index cdbb6cdda0..a39c0ab242 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -300,7 +300,7 @@ var/list/organ_cache = list() germ_level = 0 if(owner) handle_organ_mod_special() - if(!ignore_prosthetic_prefs && owner && owner.client && owner.client.prefs && owner.client.prefs.real_name == owner.real_name) + if(!ignore_prosthetic_prefs && owner && owner.client && owner.client.prefs && owner.client.prefs.read_preference(/datum/preference/name/real_name) == owner.real_name) var/status = owner.client.prefs.organ_data[organ_tag] if(status == FBP_ASSISTED) mechassist() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index f84cb35888..321074704b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -584,7 +584,7 @@ This function completely restores a damaged organ to perfect condition. owner.clear_alert("embeddedobject") if(owner && !ignore_prosthetic_prefs) - if(owner.client && owner.client.prefs && owner.client.prefs.real_name == owner.real_name) + if(owner.client && owner.client.prefs && owner.client.prefs.read_preference(/datum/preference/name/real_name) == owner.real_name) var/status = owner.client.prefs.organ_data[organ_tag] if(status == "amputated") remove_rejuv() diff --git a/code/modules/resleeving/autoresleever.dm b/code/modules/resleeving/autoresleever.dm index 63bccfcc9a..f67f121133 100644 --- a/code/modules/resleeving/autoresleever.dm +++ b/code/modules/resleeving/autoresleever.dm @@ -102,7 +102,7 @@ GLOBAL_LIST_EMPTY(active_autoresleevers) //Name matching is ugly but mind doesn't persist to look at. var/charjob var/datum/data/record/record_found - record_found = find_general_record("name",ghost_client.prefs.real_name) + record_found = find_general_record("name", ghost_client.prefs.read_preference(/datum/preference/name/real_name)) //Found their record, they were spawned previously if(record_found) diff --git a/code/modules/tgui/modules/late_choices.dm b/code/modules/tgui/modules/late_choices.dm index 3b37f2750f..c222d1035c 100644 --- a/code/modules/tgui/modules/late_choices.dm +++ b/code/modules/tgui/modules/late_choices.dm @@ -57,7 +57,7 @@ /datum/tgui_module/late_choices/tgui_data(mob/new_player/user) var/list/data = ..() - var/name = user.client.prefs.read_preference(/datum/preference/toggle/human/name_is_always_random) ? "friend" : user.client.prefs.real_name + var/name = user.client.prefs.read_preference(/datum/preference/toggle/human/name_is_always_random) ? "friend" : user.client.prefs.read_preference(/datum/preference/name/real_name) data["name"] = name data["duration"] = roundduration2text() diff --git a/code/modules/vore/eating/inbelly_spawn.dm b/code/modules/vore/eating/inbelly_spawn.dm index 87c71996b0..4e5151e424 100644 --- a/code/modules/vore/eating/inbelly_spawn.dm +++ b/code/modules/vore/eating/inbelly_spawn.dm @@ -3,7 +3,8 @@ return // Are we cool with this prey spawning in at all? - var/answer = tgui_alert(src, "[potential_prey.prefs.real_name] wants to spawn in one of your bellies. Do you accept?", "Inbelly Spawning", list("Yes", "No")) + var/prey_name = potential_prey.prefs.read_preference(/datum/preference/name/real_name) + var/answer = tgui_alert(src, "[prey_name] wants to spawn in one of your bellies. Do you accept?", "Inbelly Spawning", list("Yes", "No")) if(answer != "Yes") to_chat(potential_prey, span_notice("Your request was turned down.")) return @@ -40,7 +41,7 @@ return // Final confirmation for pred - var/confirmation_pred = tgui_alert(src, "Are you certain that you want [potential_prey.prefs.real_name] spawned in your [belly_choice][absorbed ? ", absorbed" : ""]?", "Inbelly Spawning", list("Yes", "No")) + var/confirmation_pred = tgui_alert(src, "Are you certain that you want [prey_name] spawned in your [belly_choice][absorbed ? ", absorbed" : ""]?", "Inbelly Spawning", list("Yes", "No")) if(confirmation_pred != "Yes") to_chat(potential_prey, span_notice("Your pred couldn't finish selection. Try again?")) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 433d7da940..4994966394 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -334,7 +334,7 @@ var/choice = tgui_alert(ui.user, "Warning: Saving your vore panel while in the lobby will save it to the CURRENTLY LOADED character slot, and potentially overwrite it. Are you SURE you want to overwrite your current slot with these vore bellies?", "WARNING!", list("No, abort!", "Yes, save.")) if(choice != "Yes, save.") return TRUE - else if(host.real_name != host.client.prefs.real_name || (!ishuman(host) && !issilicon(host))) + else if(host.real_name != host.client.prefs.read_preference(/datum/preference/name/real_name) || (!ishuman(host) && !issilicon(host))) var/choice = tgui_alert(ui.user, "Warning: Saving your vore panel while playing what is very-likely not your normal character will overwrite whatever character you have loaded in character setup. Maybe this is your 'playing a simple mob' slot, though. Are you SURE you want to overwrite your current slot with these vore bellies?", "WARNING!", list("No, abort!", "Yes, save.")) if(choice != "Yes, save.") return TRUE diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index 7e821fbde5..7914955ca6 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -60,8 +60,9 @@ return // Failed to load character // For now as a safety measure we will only save if the name matches. - if(prefs.real_name != persister.real_name) - NOTICE("Persist (P4P): Skipping [persister] because ORIG:[persister.real_name] != CURR:[prefs.real_name].") + var/prefs_real_name = prefs.read_preference(/datum/preference/name/real_name) + if(prefs_real_name != persister.real_name) + NOTICE("Persist (P4P): Skipping [persister] because ORIG:[persister.real_name] != CURR:[prefs_real_name].") return return prefs diff --git a/vorestation.dme b/vorestation.dme index 0b4fa6e575..6e62feab04 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2461,6 +2461,7 @@ #include "code\modules\client\preference_setup\loadout\loadout_xeno.dm" #include "code\modules\client\preference_setup\occupation\occupation.dm" #include "code\modules\client\preferences\_preference.dm" +#include "code\modules\client\preferences\names.dm" #include "code\modules\client\preferences\preferences_tg.dm" #include "code\modules\client\preferences\middleware\_middleware.dm" #include "code\modules\client\preferences\middleware\bay_adapter.dm"