From 6907ee784d8f53f563e9f300f63b5b5906602ba2 Mon Sep 17 00:00:00 2001
From: SuhEugene <32931701+SuhEugene@users.noreply.github.com>
Date: Sun, 5 May 2024 11:17:04 +0300
Subject: [PATCH] Hide invisimin users from HUDs and Ghosts (#2922)
## About The Pull Request
- Hides invisimin users from HUDs
- Hides invisimin users from ghosts
## Why It's Good For The Game
It makes eventmaking better.
## Changelog
:cl:SuhEugene
admin: made invisimin admins invisible for HUDs and ghosts
/:cl:
---
code/__DEFINES/sight.dm | 2 ++
code/modules/admin/admin_verbs.dm | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/code/__DEFINES/sight.dm b/code/__DEFINES/sight.dm
index a0ce649dd04d..ba4589985015 100644
--- a/code/__DEFINES/sight.dm
+++ b/code/__DEFINES/sight.dm
@@ -13,6 +13,8 @@
#define INVISIBILITY_OBSERVER 60
#define SEE_INVISIBLE_OBSERVER 60
+#define INVISIBILITY_INVINISMIN 80 //invisible admins
+
#define INVISIBILITY_MAXIMUM 100 //the maximum allowed for "real" objects
#define INVISIBILITY_ABSTRACT 101 //only used for abstract objects (e.g. spacevine_controller), things that are not really there.
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 0539dca13e25..ef2bfae400e4 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -403,11 +403,13 @@ GLOBAL_PROTECT(admin_verbs_hideable)
set category = "Admin.Game"
set desc = "Toggles ghost-like invisibility (Don't abuse this)"
if(holder && mob)
- if(mob.invisibility == INVISIBILITY_OBSERVER)
+ if(mob.invisibility == INVISIBILITY_INVINISMIN)
mob.invisibility = initial(mob.invisibility)
+ mob.remove_from_all_data_huds()
to_chat(mob, "Invisimin off. Invisibility reset.", confidential = TRUE)
else
- mob.invisibility = INVISIBILITY_OBSERVER
+ mob.invisibility = INVISIBILITY_INVINISMIN
+ mob.add_to_all_human_data_huds()
to_chat(mob, "Invisimin on. You are now as invisible as a ghost.", confidential = TRUE)
/client/proc/check_antagonists()