Mentor permissions fixes and such.

Created a helper proc /proc/is_mentor(client) use this when determining if someone is a mentor and they aren't the usr of the proc (rights_check uses usr)

Mentors will no longer hear ghosts while playing
Mentors will no longer see orange text around names in check_player_age panel if they have special_roles
Mentors will no longer be able to tell players with special roles through the use of player_panel
Mentors will no longer be able to aghost, use antagHUD, then return to their bodies.
This commit is contained in:
Ccomp5950
2014-06-10 19:21:40 -05:00
parent f0a75407b8
commit 77c733b17c
7 changed files with 77 additions and 24 deletions

View File

@@ -257,20 +257,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost"
set name = "Toggle AntagHUD"
set desc = "Toggles AntagHUD allowing you to see who is the antagonist"
if(!config.antag_hud_allowed && !client.holder)
if(!client)
return
var/mentor = is_mentor(usr.client)
if(!config.antag_hud_allowed && (!client.holder || mentor))
src << "\red Admins have disabled this for this round."
return
if(!client)
return
var/mob/dead/observer/M = src
if(jobban_isbanned(M, "AntagHUD"))
src << "\red <B>You have been banned from using this feature</B>"
return
if(config.antag_hud_restricted && !M.has_enabled_antagHUD &&!client.holder)
if(config.antag_hud_restricted && !M.has_enabled_antagHUD && (!client.holder || mentor))
var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No")
if(response == "No") return
M.can_reenter_corpse = 0
if(!M.has_enabled_antagHUD && !client.holder)
if(!M.has_enabled_antagHUD && (!client.holder || mentor))
M.has_enabled_antagHUD = 1
if(M.antagHUD)
M.antagHUD = 0

View File

@@ -58,11 +58,14 @@
for(var/mob/M in player_list)
if(istype(M, /mob/new_player))
continue
if(M.client && M.client.holder && (M.client.holder.rights & R_ADMIN|R_MOD) && (M.client.prefs.toggles & CHAT_DEAD)) // Show the message to admins/mods with deadchat toggled on
if(M.client && M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD))
M << rendered
continue
if(M.client && M.client.holder && !is_mentor(M.client) && (M.client.prefs.toggles & CHAT_DEAD) ) // Show the message to admins/mods with deadchat toggled on
M << rendered //Admins can hear deadchat, if they choose to, no matter if they're blind/deaf or not.
else if(M.client && M.stat == DEAD && (M.client.prefs.toggles & CHAT_DEAD)) // Show the message to regular ghosts with deadchat toggled on.
M.show_message(rendered, 2) //Takes into account blindness and such.
return
/mob/proc/say_understands(var/mob/other,var/datum/language/speaking = null)