From d5248db5e03c3595fdaae167c217e9146c4dd680 Mon Sep 17 00:00:00 2001 From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:09:58 +0200 Subject: [PATCH] Blood pool now tries cardinal move if diagonal is blocked (#22049) * blood pool now tried cardial move if diagonal is blocked * turn() instead of switch --- code/datums/spells/ethereal_jaunt.dm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 01797ab5bf3..d6197b8c2bb 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -102,11 +102,22 @@ return var/turf/newLoc = get_step(src,direction) setDir(direction) + movedelay = world.time + movespeed if(can_move(newLoc)) forceMove(newLoc) - else + return + if(!IS_DIR_DIAGONAL(direction)) to_chat(user, "Something is blocking the way!") - movedelay = world.time + movespeed + return + var/turf/possible_1 = get_step(src, turn(direction, 45)) + var/turf/possible_2 = get_step(src, turn(direction, -45)) + if(can_move(possible_1)) + forceMove(possible_1) + return + if(can_move(possible_2)) + forceMove(possible_2) + return + to_chat(user, "Something is blocking the way!") /obj/effect/dummy/spell_jaunt/proc/can_move(turf/T) if(T.flags & NOJAUNT)