From 7bdc096ee1ffe8ad071feb6a9f3fd03619392054 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sun, 22 Jun 2014 14:22:20 +0400 Subject: [PATCH] Optimizes crew console scanning to only look for mobs instead of ALL clothing items in the world. --- code/game/machinery/computer/crew.dm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index bb8d5fd997d..528815ad07e 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -108,13 +108,9 @@ /obj/machinery/computer/crew/proc/scan() - for(var/obj/item/clothing/under/C in world) - if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human))) - var/check = 0 - for(var/O in src.tracked) - if(O == C) - check = 1 - break - if(!check) - src.tracked.Add(C) + for(var/mob/living/carbon/human/H in mob_list) + if(istype(H.w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/C = H.w_uniform + if (C.has_sensor) + tracked |= C return 1 \ No newline at end of file