[MIRROR] Fixes issue where role banned players can still play roles they're banned from. [MDB IGNORE] (#23399)

* Fixes issue where role banned players can still play roles they're banned from.

* Update sql_ban_system.dm

* Some formatting updates

---------

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-08-31 00:10:42 -04:00
committed by GitHub
co-authored by Timberpoes Bloop
parent 4c0a06439d
commit f8b2329771
4 changed files with 97 additions and 52 deletions
@@ -260,8 +260,13 @@ GLOBAL_LIST_EMPTY(antagonists)
*/
/datum/antagonist/proc/is_banned(mob/player)
if(!player)
stack_trace("Called is_banned without a mob. This shouldn't happen.")
return FALSE
. = (is_banned_from(player.ckey, list(ROLE_SYNDICATE, job_rank)) || QDELETED(player))
if(!player.ckey)
return FALSE
return (is_banned_from(player.ckey, list(ROLE_SYNDICATE, job_rank)) || QDELETED(player))
/**
* Proc that replaces a player who cannot play a specific antagonist due to being banned via a poll, and alerts the player of their being on the banlist.