From 96a7facbb6ddc2d4805cda1fdb618a1c5538b9b5 Mon Sep 17 00:00:00 2001 From: Casey Date: Thu, 9 Mar 2023 15:33:21 -0500 Subject: [PATCH] Merge pull request #14641 from Heroman3003/admin-perm-fixes-also-sound Fixes some admin perms not being properly checked --- code/modules/admin/verbs/adminhelp.dm | 2 ++ code/modules/admin/verbs/adminpm.dm | 4 ++-- code/modules/admin/verbs/adminsay.dm | 2 +- code/modules/client/preference_setup/vore/02_size.dm | 9 +++++---- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 9463026769..a31ac91a3e 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -279,6 +279,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) //send this msg to all admins for(var/client/X in GLOB.admins) + if(!check_rights(R_ADMIN, 0, X)) + continue if(X.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping)) X << 'sound/effects/adminhelp.ogg' window_flash(X) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 592b20b358..4dbc2a2307 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -5,7 +5,7 @@ /client/proc/cmd_admin_pm_context(mob/M in mob_list) set category = null set name = "Admin PM Mob" - if(!holder) + if(!check_rights(R_ADMIN)) to_chat(src, "Error: Admin-PM-Context: Only administrators may use this command.") return if( !ismob(M) || !M.client ) @@ -17,7 +17,7 @@ /client/proc/cmd_admin_pm_panel() set category = "Admin" set name = "Admin PM" - if(!holder) + if(!check_rights(R_ADMIN)) to_chat(src, "Error: Admin-PM-Panel: Only administrators may use this command.") return var/list/client/targets[0] diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 84ba8e1c37..920bf9d4e3 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -12,7 +12,7 @@ log_adminsay(msg,src) for(var/client/C in GLOB.admins) - if(check_rights(R_ADMIN)) + if(check_rights(R_ADMIN, 0, C)) to_chat(C, "" + create_text_tag("admin", "ADMIN:", C) + " [key_name(usr, 1)]([admin_jump_link(mob, src)]): [msg]") feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/client/preference_setup/vore/02_size.dm b/code/modules/client/preference_setup/vore/02_size.dm index f961b8df3c..f554db44ae 100644 --- a/code/modules/client/preference_setup/vore/02_size.dm +++ b/code/modules/client/preference_setup/vore/02_size.dm @@ -224,7 +224,7 @@ return TOPIC_REFRESH else if(href_list["voice_test"]) - var/sound/S = pick(pref.voice_sound) + var/sound/S switch(pref.voice_sound) if("beep-boop") S = sound(pick(talk_sound)) @@ -254,8 +254,9 @@ S = sound(pick(goon_speak_roach_sound)) if("goon speak skelly") S = sound(pick(goon_speak_skelly_sound)) - S.frequency = pick(pref.voice_freq) - S.volume = 50 - SEND_SOUND(user, S) + if(S) + S.frequency = pick(pref.voice_freq) + S.volume = 50 + SEND_SOUND(user, S) return ..(); \ No newline at end of file