diff --git a/code/defines/client.dm b/code/defines/client.dm index fd553c1b329..5b1567597f4 100644 --- a/code/defines/client.dm +++ b/code/defines/client.dm @@ -8,6 +8,9 @@ var/seeprayers = 0 //Hosts can change their color var/ooccolor = "#b82e00" + var/muted = null //Can't talk in OOC, say, whisper, emote... anything except for adminhelp and admin-pm. An admin punishment + var/muted_complete = null //Can't talk in any way shape or form (muted + can't adminhelp or respond to admin pm-s). An admin punishment + //END Admin Things diff --git a/code/defines/mob/mob.dm b/code/defines/mob/mob.dm index 24ab032f220..9641b48678a 100644 --- a/code/defines/mob/mob.dm +++ b/code/defines/mob/mob.dm @@ -118,8 +118,6 @@ var/miming = null //checks if the guy is a mime//Human var/silent = null //Can't talk. Value goes down every life proc.//Human - var/muted = null //Can't talk in OOC, say, whisper, emote... anything except for adminhelp and admin-pm. An admin punishment - var/muted_complete = null //Can't talk in any way shape or form (muted + can't adminhelp or respond to admin pm-s). An admin punishment var/obj/hud/hud_used = null diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index eb9b378ccd1..699d019625b 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -25,7 +25,7 @@ else if (!dooc_allowed && !src.client.holder && (src.client.deadchat != 0)) usr << "OOC for dead mobs has been turned off." return - else if (src.muted || src.muted_complete) + else if (src.client && (src.client.muted || src.client.muted_complete)) src << "You are muted." return else if (findtext(msg, "byond://") && !src.client.holder) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 8ff43d7547a..a4ba3f8cd67 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -377,10 +377,13 @@ if ((M.client && M.client.holder && (M.client.holder.level >= src.level))) alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) return - M.muted = !M.muted - log_admin("[key_name(usr)] has [(M.muted ? "muted" : "voiced")] [key_name(M)].") - message_admins("\blue [key_name_admin(usr)] has [(M.muted ? "muted" : "voiced")] [key_name_admin(M)].", 1) - M << "You have been [(M.muted ? "muted" : "voiced")]. Please resolve this in adminhelp." + if(!M.client) + src << "This mob doesn't have a client tied to it." + return + M.client.muted = !M.client.muted + log_admin("[key_name(usr)] has [(M.client.muted ? "muted" : "voiced")] [key_name(M)].") + message_admins("\blue [key_name_admin(usr)] has [(M.client.muted ? "muted" : "voiced")] [key_name_admin(M)].", 1) + M << "You have been [(M.client.muted ? "muted" : "voiced")]. Please resolve this in adminhelp." if (href_list["mute_complete"]) if ((src.rank in list( "Moderator", "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) var/mob/M = locate(href_list["mute_complete"]) @@ -388,10 +391,13 @@ if ((M.client && M.client.holder && (M.client.holder.level >= src.level))) alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) return - M.muted_complete = !M.muted_complete - log_admin("[key_name(usr)] has [(M.muted_complete ? "completely muted" : "voiced (complete)")] [key_name(M)].") - message_admins("\blue [key_name_admin(usr)] has [(M.muted_complete ? "completely muted" : "voiced (complete)")] [key_name_admin(M)].", 1) - M << "You have been [(M.muted_complete ? "completely muted" : "voiced (complete)")]. You are unable to speak or even adminhelp" + if(!M.client) + src << "This mob doesn't have a client tied to it." + return + M.client.muted_complete = !M.client.muted_complete + log_admin("[key_name(usr)] has [(M.client.muted_complete ? "completely muted" : "voiced (complete)")] [key_name(M)].") + message_admins("\blue [key_name_admin(usr)] has [(M.client.muted_complete ? "completely muted" : "voiced (complete)")] [key_name_admin(M)].", 1) + M << "You have been [(M.client.muted_complete ? "completely muted" : "voiced (complete)")]. You are unable to speak or even adminhelp" if (href_list["c_mode"]) if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) @@ -1689,8 +1695,11 @@ else foo += text("Hasn't Entered Game | ") foo += text("Forcesay | ") - foo += text("Mute: [(M.muted ? "Muted" : "Voiced")] | ") - foo += text("Complete mute: [(M.muted ? "Completely Muted" : "Voiced")] | ") + if(M.client) + foo += text("Mute: [(M.client.muted ? "Muted" : "Voiced")] | ") + foo += text("Complete mute: [(M.client.muted ? "Completely Muted" : "Voiced")] | ") + else + foo += "Mute unavailable - no client" foo += text("Boot") foo += text("
") foo += text("Jump to | ") diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 60e10d4b593..84d5ccb12f7 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -10,7 +10,7 @@ if (!msg) return - if (usr.muted_complete) + if (usr.client && usr.client.muted_complete) return for (var/mob/M in world) diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 4423c156b2d..75098de01d0 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -9,7 +9,8 @@ src << "Only administrators may use this command." return - if (!src.mob || src.mob.muted || src.mob.muted_complete) + if (src.muted || src.muted_complete) + src << "You are muted." return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 448ae4e8177..913f292dd5c 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -8,7 +8,7 @@ return if(!src.mob) return - if(src.mob.muted || src.mob.muted_complete) + if(src.muted || src.muted_complete) return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 5c48329519e..303779597a5 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -10,7 +10,7 @@ if (!msg) return - if (usr.muted || src.muted_complete) + if (usr.client && (usr.client.muted || usr.client.muted_complete)) return var/icon/cross = icon('storage.dmi',"bible") diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index f84a3adf7e3..3ec0b3ae24d 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -91,7 +91,7 @@ src << "Only administrators may use this command." return if(M) - if(src.mob.muted_complete) + if(src.muted_complete) src << "You are muted have a nice day" return if (!( ismob(M) )) @@ -142,12 +142,15 @@ if (M.client && M.client.holder && (M.client.holder.level >= holder.level)) alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) return - M.muted = !M.muted + if(!M.client) + src << "This mob doesn't have a client tied to it." + return + M.client.muted = !M.client.muted - log_admin("[key_name(src)] has [(M.muted ? "muted" : "voiced")] [key_name(M)].") - message_admins("[key_name_admin(src)] has [(M.muted ? "muted" : "voiced")] [key_name_admin(M)].", 1) + log_admin("[key_name(src)] has [(M.client.muted ? "muted" : "voiced")] [key_name(M)].") + message_admins("[key_name_admin(src)] has [(M.client.muted ? "muted" : "voiced")] [key_name_admin(M)].", 1) - M << "You have been [(M.muted ? "muted" : "voiced")]." + M << "You have been [(M.client.muted ? "muted" : "voiced")]." /client/proc/cmd_admin_add_random_ai_law() diff --git a/code/modules/mob/dead/observer/say.dm b/code/modules/mob/dead/observer/say.dm index 1e88d0f2cf0..9c015e7e880 100644 --- a/code/modules/mob/dead/observer/say.dm +++ b/code/modules/mob/dead/observer/say.dm @@ -9,7 +9,7 @@ log_say("Ghost/[src.key] : [message]") - if (src.muted || src.muted_complete) + if (src.client && (src.client.muted || src.client.muted_complete)) src << "You are muted." return diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index f7c436ab780..f56f63b8644 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -62,7 +62,9 @@ message = "[src] [input]" if ("me") - if (muted || silent || muted_complete) + if(silent) + return + if (src.client && (client.muted || client.muted_complete)) src << "You are muted." return if (stat) diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 58a9fbee69d..2a89031db5f 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -7,7 +7,7 @@ log_whisper("[src.name]/[src.key] : [message]") - if (src.muted || src.muted_complete) + if (src.client && (src.client.muted || src.client.muted_complete)) src << "You are muted." return diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 65b5b770e0d..148522672ca 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -30,7 +30,10 @@ if (stat == 2) return say_dead(message) - if (muted || silent || src.muted_complete) + if (silent) + return + + if (src.client && (client.muted || src.client.muted_complete)) src << "You are muted." return diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index abe5af04ab0..6108dd392ba 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -2,7 +2,7 @@ if (!message) return - if (muted || src.muted_complete) + if (src.client && (client.muted || src.client.muted_complete)) src << "You are muted." return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2f383fffe67..087bf09b1b9 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -578,7 +578,7 @@ if(href_list["priv_msg"]) var/mob/M = locate(href_list["priv_msg"]) if(M) - if(muted_complete) + if(src.client && client.muted_complete) src << "You are muted have a nice day" return if (!ismob(M))