Prevents diagonal teleports on the syndicate handheld teleporter (#15252)

* Prevents diagonal teleports

* Makes it use sprite direction on diagonal
This commit is contained in:
Qwertytoforty
2021-01-10 15:32:05 -05:00
committed by GitHub
parent 4f853d4a1d
commit a45cd040a2
@@ -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, "<span class='warning'>The [src] is recharging still.</span>")
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)