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 <orion@snowfrost.garden>

* variable name fix

---------

Co-authored-by: Pierre-Louis <hernandezpierrelouis@protonmail.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
This commit is contained in:
Pierre-Louis
2024-01-14 13:00:11 +00:00
committed by GitHub
co-authored by warriorstar-orion Pierre-Louis
parent 51f0f15aec
commit dc6604cecc
+5 -3
View File
@@ -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)