From 8f4762e44276d2570e81beee70d4236921a7ed37 Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Mon, 11 Oct 2021 18:13:46 +0100 Subject: [PATCH 1/4] jaunting respects dense atoms on a turf too, no more AI core jaunting --- code/datums/spells/ethereal_jaunt.dm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 4c7c6b76b36..10438ee4925 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -55,11 +55,10 @@ sleep(jaunt_in_time) qdel(holder) if(!QDELETED(target)) - if(mobloc.density) + if(!(target.Move(mobloc))) for(var/turf/T in orange(7)) - if(T) - if(target.Move(T)) - break + if(T && target.Move(T)) + break target.canmove = 1 /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/proc/jaunt_steam(mobloc) From 04d0fb1c1f91563f83288df5f4484cb74b25b71a Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Mon, 11 Oct 2021 20:44:21 +0100 Subject: [PATCH 2/4] non-space priority --- code/datums/spells/ethereal_jaunt.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 10438ee4925..742d3a5fda1 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -57,9 +57,15 @@ if(!QDELETED(target)) if(!(target.Move(mobloc))) for(var/turf/T in orange(7)) + if(istype(T, /turf/space)) + continue if(T && target.Move(T)) - break - target.canmove = 1 + target.canmove = 1 + return + for(var/turf/space/S in orange(7)) //loop for space turfs in case there were no normal ones last loop + if(target.Move(S)) + target.canmove = 1 + return /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/proc/jaunt_steam(mobloc) var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() From bb89924e6ee5d7b9b20c9881fbf8da319dace376 Mon Sep 17 00:00:00 2001 From: S34NW <12197162+S34NW@users.noreply.github.com> Date: Mon, 11 Oct 2021 20:48:43 +0100 Subject: [PATCH 3/4] more sanity checks --- code/datums/spells/ethereal_jaunt.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 742d3a5fda1..85b1d967db1 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -63,9 +63,9 @@ target.canmove = 1 return for(var/turf/space/S in orange(7)) //loop for space turfs in case there were no normal ones last loop - if(target.Move(S)) - target.canmove = 1 - return + if(S && target.Move(S)) + break + target.canmove = 1 //if there are no valid tiles in a range of 7, just let them spawn wherever they are currently /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/proc/jaunt_steam(mobloc) var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread() From 588f3fa795409ec0104fd9137b8c76eb4a2b2960 Mon Sep 17 00:00:00 2001 From: S34N <12197162+S34NW@users.noreply.github.com> Date: Tue, 12 Oct 2021 22:50:29 +0100 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com> --- code/datums/spells/ethereal_jaunt.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 85b1d967db1..972b050007c 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -57,15 +57,15 @@ if(!QDELETED(target)) if(!(target.Move(mobloc))) for(var/turf/T in orange(7)) - if(istype(T, /turf/space)) + if(isspaceturf(T)) continue if(T && target.Move(T)) - target.canmove = 1 + target.canmove = TRUE return for(var/turf/space/S in orange(7)) //loop for space turfs in case there were no normal ones last loop if(S && target.Move(S)) break - target.canmove = 1 //if there are no valid tiles in a range of 7, just let them spawn wherever they are currently + target.canmove = TRUE //if there are no valid tiles in a range of 7, just let them spawn wherever they are currently /obj/effect/proc_holder/spell/targeted/ethereal_jaunt/proc/jaunt_steam(mobloc) var/datum/effect_system/steam_spread/steam = new /datum/effect_system/steam_spread()