From 294a57a5a7de7c74ce90880db0a1ca05beb1f148 Mon Sep 17 00:00:00 2001 From: comma Date: Sun, 3 Sep 2017 14:54:57 +0300 Subject: [PATCH] Makes teleporter mishaps not mess with Z that much It was causing issues when people got teleported onto empty zlevels, which makes them impossible to rescue with overmap. --- code/game/machinery/teleporter.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 677c83c5e1..37ea5933c7 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -206,9 +206,9 @@ O.show_message("Failure: Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.") return if (istype(M, /atom/movable)) - if(prob(5) && !accurate) //oh dear a problem, put em in deep space + if(prob(5) && !accurate) //oh dear a problem var/turf/T = get_turf(M) - var/destination_z = T ? GLOB.using_map.get_transit_zlevel(T.z) : pick(GLOB.using_map.player_levels) + var/destination_z = T ? GetConnectedZlevels(T.z) : GetConnectedZlevels(z) do_teleport(M, locate(rand((2*TRANSITIONEDGE), world.maxx - (2*TRANSITIONEDGE)), rand((2*TRANSITIONEDGE), world.maxy - (2*TRANSITIONEDGE)), destination_z), 2) else do_teleport(M, com.locked) //dead-on precision