From b7dcef16558d76e6c14fde097af65f69fc2c8f7d Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 29 Oct 2017 17:06:15 +0100 Subject: [PATCH 1/4] Ignore now also shows ghost names --- code/modules/client/verbs/ooc.dm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index e2022729be1..dab140a8f38 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -259,9 +259,17 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR) set category = "OOC" set desc ="Ignore a player's messages on the OOC channel" - var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in sortKey(GLOB.clients) + var/list/ghosts = list() + for(var/mob/dead/observer/O in GLOB.dead_mob_list) + ghosts += O + var/choices = sortKey(GLOB.clients + ghosts) + + var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in choices if(!selection) return + if(ismob(selection)) + var/mob/dead/observer/O = selection + selection = O.client if(selection == src) to_chat(src, "You can't ignore yourself.") return From 98ba63689f097b84375f2ee8020e6662746e2519 Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 29 Oct 2017 17:12:42 +0100 Subject: [PATCH 2/4] No cheating. --- code/modules/client/verbs/ooc.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index dab140a8f38..ef1e2511728 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -259,9 +259,11 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR) set category = "OOC" set desc ="Ignore a player's messages on the OOC channel" + var/list/ghosts = list() - for(var/mob/dead/observer/O in GLOB.dead_mob_list) - ghosts += O + if(isobserver(mob)) + for(var/mob/dead/observer/O in GLOB.dead_mob_list) + ghosts += O var/choices = sortKey(GLOB.clients + ghosts) var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in choices From c92a741a8c32d6fcff49ca941ce083d60ec1d25f Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 29 Oct 2017 17:27:37 +0100 Subject: [PATCH 3/4] No repeats --- code/modules/client/verbs/ooc.dm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index ef1e2511728..90861dd3d87 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -260,18 +260,18 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR) set desc ="Ignore a player's messages on the OOC channel" - var/list/ghosts = list() - if(isobserver(mob)) - for(var/mob/dead/observer/O in GLOB.dead_mob_list) - ghosts += O - var/choices = sortKey(GLOB.clients + ghosts) - + var/see_ghost_names = isobserver(mob) + var/list/choices = list() + for(var/client/C in GLOB.clients) + if(isobserver(C.mob) && see_ghost_names) + choices["[C.mob]([C])"] = C + else + choices["[C]"] = C + choices = sortList(choices) var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in choices - if(!selection) + if(!selection || !(selection in choices)) return - if(ismob(selection)) - var/mob/dead/observer/O = selection - selection = O.client + selection = choices[selection] if(selection == src) to_chat(src, "You can't ignore yourself.") return From fe40c71262c9f67bba2c1e5bb77ccac867e742c6 Mon Sep 17 00:00:00 2001 From: AnturK Date: Mon, 30 Oct 2017 20:49:35 +0100 Subject: [PATCH 4/4] Dropped redundant to string. --- code/modules/client/verbs/ooc.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 90861dd3d87..a0c1e2135af 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -266,7 +266,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR) if(isobserver(C.mob) && see_ghost_names) choices["[C.mob]([C])"] = C else - choices["[C]"] = C + choices[C] = C choices = sortList(choices) var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in choices if(!selection || !(selection in choices))