From 0af24bf915c95a5b54572cd8d6b64dcf0e065ccf Mon Sep 17 00:00:00 2001 From: Spookerton <918997+Spookerton@users.noreply.github.com> Date: Wed, 22 Jan 2025 13:40:41 +0000 Subject: [PATCH] [MIRROR] iscultist is safe, accepts mobs and minds --- code/game/antagonist/station/cultist.dm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/code/game/antagonist/station/cultist.dm b/code/game/antagonist/station/cultist.dm index 0d0960560281a..9c5d40fd16f8b 100644 --- a/code/game/antagonist/station/cultist.dm +++ b/code/game/antagonist/station/cultist.dm @@ -14,11 +14,14 @@ GLOBAL_DATUM_INIT(cult, /datum/antagonist/cultist, new) -/proc/iscultist(mob/player) - if(!GLOB.cult || !player.mind) - return 0 - if(player.mind in GLOB.cult.current_antagonists) - return 1 + +/// Tests if subject is a cultist. Subject may be a /mob or /datum/mind. +/proc/iscultist(mob/subject) + var/datum/mind/mind = subject + if (ismob(mind)) + mind = subject.mind + return istype(mind) && (mind in GLOB.cult?.current_antagonists) + /datum/antagonist/cultist id = MODE_CULTIST