From 4b29a45263a6346e7dfee2bfc00e1b2e755c9a05 Mon Sep 17 00:00:00 2001 From: Squirgenheimer Date: Mon, 5 Nov 2018 22:05:03 -0500 Subject: [PATCH] autotraitor.dm: opted for continue statement in a couple of places, reworded a comment --- .../game/gamemodes/autotraitor/autotraitor.dm | 27 ++++++++++--------- code/modules/client/client defines.dm | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 281e0ef9f04..bf9fbb5a9e5 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -78,23 +78,24 @@ for(var/mob/living/player in GLOB.mob_list) if(player.client && player.stat != DEAD) playercount += 1 - if(player.mind) - if(player.mind.special_role) - traitorcount += 1 - else - if(ishuman(player) || isrobot(player) || isAI(player)) - if((ROLE_TRAITOR in player.client.prefs.be_special) && !player.client.skip_antag && !jobban_isbanned(player, ROLE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) - possible_traitors += player.mind + if(!player.mind) + continue + if(player.mind.special_role) + traitorcount += 1 + continue + if(ishuman(player) || isrobot(player) || isAI(player)) + if((ROLE_TRAITOR in player.client.prefs.be_special) && !player.client.skip_antag && !jobban_isbanned(player, ROLE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) + possible_traitors += player.mind for(var/datum/mind/player in possible_traitors) for(var/job in restricted_jobs) if(player.assigned_role == job) possible_traitors -= player - if(player.current) // Remove mindshield-implanted mobs from the list - if(ishuman(player.current)) - var/mob/living/carbon/human/H = player.current - for(var/obj/item/implant/mindshield/I in H.contents) - if(I && I.implanted) - possible_traitors -= player + if(!player.current || !ishuman(player.current)) // Remove mindshield-implanted mobs from the list + continue + var/mob/living/carbon/human/H = player.current + for(var/obj/item/implant/mindshield/I in H.contents) + if(I && I.implanted) + possible_traitors -= player //message_admins("Live Players: [playercount]") //message_admins("Live Traitors: [traitorcount]") diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 5327eca3838..c88347a305b 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -12,7 +12,7 @@ //OTHER// ///////// var/datum/preferences/prefs = null - var/skip_antag = FALSE //Decline to be selected as a game mode antagonist. + var/skip_antag = FALSE //TRUE when a player declines to be included for the selection process of game mode antagonists. var/move_delay = 1 var/moving = null var/adminobs = null