From 3c0902ac98293ae435b4feb5fa4a8e2b96cea8c4 Mon Sep 17 00:00:00 2001 From: ike709 Date: Wed, 12 Feb 2020 08:31:16 -0600 Subject: [PATCH] Fixes multi-z photography (#49287) * Fixes multi-z photography * Update code/modules/photography/camera/camera.dm Co-Authored-By: Jordan Brown * Removes unnecessary var * Close those parentheses Co-authored-by: Jordan Brown --- code/modules/photography/camera/camera.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index 2bcd2ad4f3e..62ff1f78950 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -180,8 +180,14 @@ var/list/mobs = list() var/blueprints = FALSE var/clone_area = SSmapping.RequestBlockReservation(size_x * 2 + 1, size_y * 2 + 1) - for(var/turf/T in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z))) - if((ai_user && GLOB.cameranet.checkTurfVis(T)) || (T in seen)) + for(var/turf/placeholder in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z))) + var/turf/T = placeholder + while(istype(T, /turf/open/openspace)) //Multi-z photography + T = SSmapping.get_turf_below(T) + if(!T) + break + + if(T && ((ai_user && GLOB.cameranet.checkTurfVis(placeholder)) || (placeholder in seen))) turfs += T for(var/mob/M in T) mobs += M