From 1097b389731bee591ec22ad39cb2fa0edd3fafdf Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Wed, 18 May 2022 00:35:42 -0500 Subject: [PATCH] Fixes strange runtime with restart votes (#67080) So, I refactored votes a little bit ago. This line was present in the result process for restart votes. for(var/client/C in GLOB.admins + GLOB.deadmins) if(!C.is_afk() && check_rights_for(C, R_SERVER)) active_admins = TRUE break So, I converted it to this. for(var/client/online_admin as anything in GLOB.admins | GLOB.deadmins) if(online_admin.is_afk() || !check_rights_for(online_admin, R_SERVER)) continue Seems fine, right? Unfortunately, no. GLOB.deadmins is a global list of deadminned ckeys. Not deadminned clients. So, the original loop iterated over a combined list of clients AND ckeys, but ONLY typechecked for clients. Why were we adding in ckeys in the first place, if it didn't even check them? No idea. But it seems like, since no one noticed restart votes weren't checking for deadminned admins in the first place, there isn't a reason to continue to consider them. Admins can re-admin to cancel restart votes or address the server's concerns if they're online, I suppose. --- code/datums/votes/restart_vote.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/votes/restart_vote.dm b/code/datums/votes/restart_vote.dm index fbea2436e49..c71bdb8170e 100644 --- a/code/datums/votes/restart_vote.dm +++ b/code/datums/votes/restart_vote.dm @@ -44,7 +44,7 @@ return if(winning_option == CHOICE_RESTART) - for(var/client/online_admin as anything in GLOB.admins | GLOB.deadmins) + for(var/client/online_admin as anything in GLOB.admins) if(online_admin.is_afk() || !check_rights_for(online_admin, R_SERVER)) continue