From 7281e1f951f6070938eb59c5df99a39e2927b69f Mon Sep 17 00:00:00 2001 From: skull132 Date: Sun, 14 Aug 2016 22:07:04 +0300 Subject: [PATCH] Fixes #730 (#746) AOOC is now added to players upon reconnecting, if they are an antag. Technically a lazy fix, because the verb should maybe be a mob verb instead, and thus be added automatically. But hey, it works. --- code/modules/admin/verbs/antag-ooc.dm | 9 +++++++++ code/modules/client/client procs.dm | 3 +++ html/changelogs/skull132-aooc_fix.yml | 12 ++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 html/changelogs/skull132-aooc_fix.yml diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm index af9d69c40c7..f8251796ff8 100644 --- a/code/modules/admin/verbs/antag-ooc.dm +++ b/code/modules/admin/verbs/antag-ooc.dm @@ -28,3 +28,12 @@ M << "" + create_text_tag("aooc", "Antag-OOC:", M.client) + " [display_name]: [msg]" log_ooc("(ANTAG) [key] : [msg]") + +// Checks if a newly joined player is an antag, and adds the AOOC verb if they are. +// Because they're tied to client objects, this gets removed every time you disconnect. +/client/proc/add_aooc_if_necessary() + if (!src.mob || !src.mob.mind) + return + + if (player_is_antag(src.mob.mind)) + src.verbs += /client/proc/aooc diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 45d3a861ee9..033b910149c 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -284,6 +284,9 @@ if (outdated_greeting_info) server_greeting.display_to_client(src, outdated_greeting_info) + // Check code/modules/admin/verbs/antag-ooc.dm for definition + add_aooc_if_necessary() + ////////////// //DISCONNECT// ////////////// diff --git a/html/changelogs/skull132-aooc_fix.yml b/html/changelogs/skull132-aooc_fix.yml new file mode 100644 index 00000000000..d4cfce77b7e --- /dev/null +++ b/html/changelogs/skull132-aooc_fix.yml @@ -0,0 +1,12 @@ +author: Skull132 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixed a bug where A-OOC was removed from antagonists upon a disconnect. It's now added back in during a reconnect."