From 06a1510766a335b6723d96f0f1806e34024e1ccd Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Thu, 14 May 2015 05:36:13 -0400 Subject: [PATCH] Optimizes stuffs --- code/modules/lighting/lighting_process.dm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code/modules/lighting/lighting_process.dm b/code/modules/lighting/lighting_process.dm index a16a0317db5..3159cfcd852 100644 --- a/code/modules/lighting/lighting_process.dm +++ b/code/modules/lighting/lighting_process.dm @@ -1,3 +1,4 @@ + /datum/controller/process/lighting/setup() name = "lighting" schedule_interval = LIGHTING_INTERVAL @@ -7,17 +8,21 @@ /datum/controller/process/lighting/doWork() for(var/datum/light_source/L in lighting_update_lights) if(L.needs_update) - if(L.destroyed) + if(L.destroyed || L.check() || L.force_update) L.remove_lum() - else if(L.check() || L.force_update) - L.remove_lum() - L.apply_lum() + if(!L.destroyed) L.apply_lum() L.force_update = 0 L.needs_update = 0 + + scheck() + lighting_update_lights.Cut() for(var/atom/movable/lighting_overlay/O in lighting_update_overlays) if(O.needs_update) O.update_overlay() O.needs_update = 0 + + scheck() + lighting_update_overlays.Cut() \ No newline at end of file