Allows roundstart observers to freely use antag HUD without losing respawnability (#23009)

* First pass

* do away with old antag hud variable

* rework cannotPossess

* some verification + cleanups

* Update code/modules/mob/dead/observer/observer_base.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* splits up log call

* Slightly refactor proc calls, continuing contra's review

* Log admin

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Luc
2023-11-21 13:00:13 +00:00
committed by GitHub
co-authored by Contrabang
parent f70b534aee
commit 9384c2a074
19 changed files with 74 additions and 34 deletions
@@ -828,3 +828,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/datum/spawners_menu/menu = new /datum/spawners_menu(src)
menu.ui_interact(src)
/**
* Check if a player has antag-hudded, and if so, if they can rejoin.
* Returns TRUE if the player can rejoin, and FALSE if the player is ineligible to rejoin.
* If allow_roundstart_observers is FALSE (TRUE by default), then any observers who were able to ahud due to joining roundstart will be excluded as well.
*/
/mob/dead/observer/proc/check_ahud_rejoin_eligibility(allow_roundstart_observers = TRUE)
if(!GLOB.configuration.general.restrict_antag_hud_rejoin || !has_ahudded())
return TRUE
if(is_roundstart_observer())
return allow_roundstart_observers
return FALSE