From 8465defbb0f55c00f4a05215bdae5081c2e501d7 Mon Sep 17 00:00:00 2001 From: Cruix Date: Mon, 25 Dec 2017 19:13:37 -0600 Subject: [PATCH 1/2] Modified the starting locations of advanced camera console eyes (#33759) * Modified the starting locations of advanced camera console eyes Made shuttle navigation computers no longer work on z levels they are not locked to * Advanced camera eyes do not start on the console if they use static and the console is in camera view but not on a usable z-level --- .../machinery/computer/camera_advanced.dm | 23 ++++++++++++++----- code/modules/shuttle/navigation_computer.dm | 5 +++- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 44d6d5abe4..e59bb1692e 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -83,12 +83,23 @@ if(!eyeobj.eye_initialized) var/camera_location - for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) - if(!C.can_use() || z_lock.len && !(C.z in z_lock)) - continue - if(C.network & networks) - camera_location = get_turf(C) - break + var/turf/myturf = get_turf(src) + if(eyeobj.use_static) + if((!z_lock.len || (myturf.z in z_lock)) && GLOB.cameranet.checkTurfVis(myturf)) + camera_location = myturf + else + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) + if(!C.can_use() || z_lock.len && !(C.z in z_lock)) + continue + var/list/network_overlap = networks & C.network + if(network_overlap.len) + camera_location = get_turf(C) + break + else + camera_location = myturf + if(z_lock.len && !(myturf.z in z_lock)) + camera_location = locate(round(world.maxx/2), round(world.maxy/2), z_lock[1]) + if(camera_location) eyeobj.eye_initialized = TRUE give_eye_control(L) diff --git a/code/modules/shuttle/navigation_computer.dm b/code/modules/shuttle/navigation_computer.dm index de1b0022f6..739e057177 100644 --- a/code/modules/shuttle/navigation_computer.dm +++ b/code/modules/shuttle/navigation_computer.dm @@ -172,7 +172,10 @@ var/mob/camera/aiEye/remote/shuttle_docker/the_eye = eyeobj var/turf/eyeturf = get_turf(the_eye) if(!eyeturf) - return + return SHUTTLE_DOCKER_BLOCKED + if(z_lock.len && !(eyeturf.z in z_lock)) + return SHUTTLE_DOCKER_BLOCKED + . = SHUTTLE_DOCKER_LANDING_CLEAR var/list/bounds = shuttle_port.return_coords(the_eye.x - x_offset, the_eye.y - y_offset, the_eye.dir) var/list/overlappers = SSshuttle.get_dock_overlap(bounds[1], bounds[2], bounds[3], bounds[4], the_eye.z)