From a45cd040a221e8f935ad2e6021759b7607702d7d Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Sun, 10 Jan 2021 15:32:05 -0500 Subject: [PATCH] Prevents diagonal teleports on the syndicate handheld teleporter (#15252) * Prevents diagonal teleports * Makes it use sprite direction on diagonal --- code/game/objects/items/devices/traitordevices.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 2336be40cfb..d6c73461e76 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -219,6 +219,7 @@ effective or pretty fucking useless. qdel(src) /obj/item/teleporter/proc/attempt_teleport(mob/user, EMP_D = FALSE) + dir_correction(user) if(!charges) to_chat(user, "The [src] is recharging still.") return @@ -269,6 +270,14 @@ effective or pretty fucking useless. if(istype(T, /turf/simulated/floor) || istype(T, /turf/space) || istype(T, /turf/simulated/shuttle/floor) || istype(T, /turf/simulated/shuttle/floor4) || istype(T, /turf/simulated/shuttle/plating)) return TRUE +/obj/item/teleporter/proc/dir_correction(mob/user) //Direction movement, screws with teleport distance and saving throw, and thus must be removed first + var/temp_direction = user.dir + switch(temp_direction) + if(NORTHEAST || SOUTHEAST) + user.dir = EAST + if(NORTHWEST || SOUTHWEST) + user.dir = WEST + /obj/item/teleporter/proc/panic_teleport(mob/user, turf/destination, direction = NORTH) var/saving_throw switch(direction)