From 58fa687ce11526f7d120dbe43e08fe8b16a1fed6 Mon Sep 17 00:00:00 2001 From: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Date: Sun, 5 Feb 2023 07:23:09 +1000 Subject: [PATCH] Merge pull request #14434 from VOREStation/upstream-merge-8914 [MIRROR] Adds a proc to fix player notes listings --- code/modules/admin/fix_player_notes_listing.dm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 code/modules/admin/fix_player_notes_listing.dm diff --git a/code/modules/admin/fix_player_notes_listing.dm b/code/modules/admin/fix_player_notes_listing.dm new file mode 100644 index 0000000000..3ab0f6c4bc --- /dev/null +++ b/code/modules/admin/fix_player_notes_listing.dm @@ -0,0 +1,16 @@ +/proc/fix_player_notes_listing() + var/list/has_notes = list() + // flist() dir names include the / + for(var/subdir in flist("data/player_saves/")) + for(var/ckey in flist("data/player_saves/[subdir]")) + if(fexists("data/player_saves/[subdir][ckey]info.sav")) + has_notes += copytext(ckey, 1, -1) // Trim the tailing / + + //Updating list of keys with notes on them + var/savefile/note_list = new("data/player_notes.sav") + var/list/note_keys + note_list >> note_keys + if(!note_keys) note_keys = list() + note_keys |= has_notes + note_list << note_keys + del(note_list) // savefile, so NOT qdel