From 1344de844b9f8b95ba2b4cdabe983e7b0c24483e Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sat, 1 Aug 2015 15:20:44 -0400 Subject: [PATCH] DVIEW Fixes --- code/__DEFINES/misc.dm | 3 ++- code/modules/lighting/light_source.dm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 6d24ef3099b..5082f480ee0 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -142,4 +142,5 @@ #define FOR_DVIEW(type, range, center, invis_flags) \ dview_mob.loc = center; \ dview_mob.see_invisible = invis_flags; \ - for(type in view(range, dview_mob)) \ No newline at end of file + for(type in view(range, dview_mob)) +#define END_FOR_DVIEW dview_mob.loc = null \ No newline at end of file diff --git a/code/modules/lighting/light_source.dm b/code/modules/lighting/light_source.dm index 0b6324a14a4..72618280137 100644 --- a/code/modules/lighting/light_source.dm +++ b/code/modules/lighting/light_source.dm @@ -177,6 +177,7 @@ T.affecting_lights += src effect_turf += T + END_FOR_DVIEW /datum/light_source/proc/remove_lum() applied = 0 @@ -201,11 +202,10 @@ var/list/view[0] FOR_DVIEW(var/turf/T, light_range, source_turf, INVISIBILITY_LIGHTING) view += T //Filter out turfs. - + END_FOR_DVIEW //This is the part where we calculate new turfs (if any) var/list/new_turfs = view - effect_turf //This will result with all the tiles that are added. for(var/turf/T in new_turfs) - //Big huge copy paste from apply_lum() incoming because screw unreadable defines and screw proc call overhead. if(T.lighting_overlay) LUM_FALLOFF(., T, source_turf) . *= light_power