From 1a74b536d72df3c4155718e2627c16ba84ca18bd Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 2 Jun 2015 10:04:47 +0200 Subject: [PATCH] Active role counting tweak. The number of Any players now properly respects activity. Borgs should now properly increase the number of players for a given job. --- code/modules/events/event_dynamic.dm | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/code/modules/events/event_dynamic.dm b/code/modules/events/event_dynamic.dm index 0dbe3a5017..3539130c27 100644 --- a/code/modules/events/event_dynamic.dm +++ b/code/modules/events/event_dynamic.dm @@ -188,28 +188,35 @@ var/list/event_last_fired = list() active_with_role["Cyborg"] = 0 active_with_role["Janitor"] = 0 active_with_role["Gardener"] = 0 - active_with_role["Any"] = player_list.len for(var/mob/M in player_list) - if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive + if(!M.mind || !M.client || M.client.is_afk(10 MINUTES)) // longer than 10 minutes AFK counts them as inactive continue - if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module") - active_with_role["Engineer"]++ - if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer")) + active_with_role["Any"]++ + + if(istype(M, /mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = M + if(R.module) + if(istype(R.module, /obj/item/weapon/robot_module/engineering)) + active_with_role["Engineer"]++ + else if(istype(R.module, /obj/item/weapon/robot_module/security)) + active_with_role["Security"]++ + else if(istype(R.module, /obj/item/weapon/robot_module/medical)) + active_with_role["Medical"]++ + else if(istype(R.module, /obj/item/weapon/robot_module/research)) + active_with_role["Scientist"]++ + + if(M.mind.assigned_role in engineering_positions) active_with_role["Engineer"]++ - if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module") - active_with_role["Medical"]++ if(M.mind.assigned_role in medical_positions) active_with_role["Medical"]++ - if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module") - active_with_role["Security"]++ if(M.mind.assigned_role in security_positions) active_with_role["Security"]++ - if(M.mind.assigned_role in list("Research Director", "Scientist")) + if(M.mind.assigned_role in science_positions) active_with_role["Scientist"]++ if(M.mind.assigned_role == "AI")