[MIRROR] mass refactor of holder checks (#11155)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-07-08 19:31:10 +02:00
committed by GitHub
co-authored by Kashargul
parent 54d0d16826
commit 7161a6c22e
60 changed files with 381 additions and 123 deletions
+10 -10
View File
@@ -214,7 +214,7 @@ Works together with spawning an observer, noted above.
//RS Port #658 Start
/mob/observer/dead/proc/check_area()
if(client?.holder)
if(check_rights_for(client, R_HOLDER))
return
if(!isturf(loc))
return
@@ -251,7 +251,7 @@ Works together with spawning an observer, noted above.
B.update()
if(ghost.client)
ghost.client.time_died_as_mouse = ghost.timeofdeath
if(ghost.client && !ghost.client.holder && !CONFIG_GET(flag/antag_hud_allowed)) // For new ghosts we remove the verb from even showing up if it's not allowed.
if(ghost.client && !check_rights_for(ghost.client, R_HOLDER) && !CONFIG_GET(flag/antag_hud_allowed)) // For new ghosts we remove the verb from even showing up if it's not allowed.
remove_verb(ghost, /mob/observer/dead/verb/toggle_antagHUD) // Poor guys, don't know what they are missing!
return ghost
@@ -368,18 +368,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set name = "Toggle AntagHUD"
set desc = "Toggles AntagHUD allowing you to see who is the antagonist"
if(!CONFIG_GET(flag/antag_hud_allowed) && !client.holder)
if(!CONFIG_GET(flag/antag_hud_allowed) && !check_rights_for(client, R_HOLDER))
to_chat(src, span_filter_notice(span_red("Admins have disabled this for this round.")))
return
if(jobban_isbanned(src, JOB_ANTAGHUD))
to_chat(src, span_filter_notice(span_red(span_bold("You have been banned from using this feature"))))
return
if(CONFIG_GET(flag/antag_hud_restricted) && !has_enabled_antagHUD && !client.holder)
if(CONFIG_GET(flag/antag_hud_restricted) && !has_enabled_antagHUD && !check_rights_for(client, R_HOLDER))
var/response = tgui_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?",list("Yes","No"))
if(response != "Yes") return
can_reenter_corpse = FALSE
set_respawn_timer(-1) // Foreeeever
if(!has_enabled_antagHUD && !client.holder)
if(!has_enabled_antagHUD && !check_rights_for(client, R_HOLDER))
has_enabled_antagHUD = TRUE
antagHUD = !antagHUD
@@ -388,7 +388,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/observer/dead/proc/jumpable_areas()
var/list/areas = return_sorted_areas()
if(client?.holder)
if(check_rights_for(client, R_HOLDER))
return areas
for(var/key in areas)
@@ -402,7 +402,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/observer/dead/proc/jumpable_mobs()
var/list/mobs = getmobs()
if(client?.holder)
if(check_rights_for(client, R_HOLDER))
return mobs
for(var/key in mobs)
@@ -466,7 +466,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
ManualFollow(M || jumpable_mobs()[mobname])
/mob/observer/dead/forceMove(atom/destination, direction, movetime, just_spawned = FALSE) // pass movetime through
if(client?.holder)
if(check_rights_for(client, R_HOLDER))
return ..()
if(get_z(destination) in using_map?.secret_levels)
@@ -486,7 +486,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return ..()
/mob/observer/dead/Move(atom/newloc, direct = 0, movetime)
if(client?.holder)
if(check_rights_for(client, R_HOLDER))
return ..()
if(get_z(newloc) in using_map?.secret_levels)
@@ -770,7 +770,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
//This is called when a ghost is drag clicked to something.
/mob/observer/dead/MouseDrop(atom/over)
if(!usr || !over) return
if (isobserver(usr) && usr.client && usr.client.holder && isliving(over))
if (isobserver(usr) && usr.client && check_rights_for(usr.client, R_HOLDER) && isliving(over))
if (usr.client.holder.cmd_ghost_drag(src,over))
return