From dc6604cecc350ae752a4cb64980cbc9ed4d11418 Mon Sep 17 00:00:00 2001 From: Pierre-Louis <44984704+PIerreLouisH@users.noreply.github.com> Date: Sun, 14 Jan 2024 14:00:11 +0100 Subject: [PATCH] Fix ghost bar character selector breaking when multiple characters share the same name (#23610) * Ghost bar character select no longer break for shared names Ghost bar character selector now use an unique ID and not a name as an identifier. Having two characters with the same name no longer break ghost bar selector. Hence Fixes #23608 * small fixs * Update code/modules/ruins/ghost_bar.dm Co-authored-by: warriorstar-orion * variable name fix --------- Co-authored-by: Pierre-Louis Co-authored-by: warriorstar-orion --- code/modules/ruins/ghost_bar.dm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/ruins/ghost_bar.dm b/code/modules/ruins/ghost_bar.dm index 879580a8a26..c8ba7d917da 100644 --- a/code/modules/ruins/ghost_bar.dm +++ b/code/modules/ruins/ghost_bar.dm @@ -15,9 +15,11 @@ if(alert(user, "Would you like to use one of your saved characters in your character creator?",, "Yes", "No") == "Yes") var/list/our_characters_names = list() var/list/our_character_saves = list() - for(var/datum/character_save/saves in user.client.prefs.character_saves) - our_characters_names += saves.real_name - our_character_saves += list(saves.real_name = saves) + for(var/index in 1 to length(user.client.prefs.character_saves)) + var/datum/character_save/saves = user.client.prefs.character_saves[index] + var/slot_name = "[saves.real_name] (Slot #[index])" + our_characters_names += slot_name + our_character_saves += list(slot_name = saves) var/character_name = tgui_input_list(user, "Select a character", "Character selection", our_characters_names) if(!character_name)