From 517ba3410e6e44d7703aa10b13935ef92156e170 Mon Sep 17 00:00:00 2001 From: ninjanomnom Date: Wed, 10 Oct 2018 11:24:53 -0400 Subject: [PATCH 1/2] Fixes an orbit runtime from orbiters deleting at inopportune times --- code/datums/components/orbiter.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/datums/components/orbiter.dm b/code/datums/components/orbiter.dm index 592ba0679a3..ec738c46890 100644 --- a/code/datums/components/orbiter.dm +++ b/code/datums/components/orbiter.dm @@ -106,7 +106,7 @@ if(master.loc == oldloc) return - var/turf/newturf = get_turf(parent) + var/turf/newturf = get_turf(master) if(!newturf) qdel(src) @@ -122,10 +122,13 @@ while(ismovableatom(target)) RegisterSignal(target, COMSIG_MOVABLE_MOVED, orbited_spy, TRUE) target = target.loc - + + var/atom/curloc = master.loc for(var/i in orbiters) var/atom/movable/thing = i - if(thing.loc == newturf) + if(master.loc != curloc) // We moved again, cancel current operation + break + if(QDELETED(thing) || thing.loc == newturf) continue thing.forceMove(newturf) CHECK_TICK From f039c02b204846b50d505446c7bd48022647e69e Mon Sep 17 00:00:00 2001 From: ninjanomnom Date: Fri, 12 Oct 2018 17:20:19 -0400 Subject: [PATCH 2/2] Only check if we moved when a checktick sleep happens --- code/datums/components/orbiter.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/datums/components/orbiter.dm b/code/datums/components/orbiter.dm index ec738c46890..f3993e0678b 100644 --- a/code/datums/components/orbiter.dm +++ b/code/datums/components/orbiter.dm @@ -126,12 +126,13 @@ var/atom/curloc = master.loc for(var/i in orbiters) var/atom/movable/thing = i - if(master.loc != curloc) // We moved again, cancel current operation - break if(QDELETED(thing) || thing.loc == newturf) continue thing.forceMove(newturf) - CHECK_TICK + if(CHECK_TICK && master.loc != curloc) + // We moved again during the checktick, cancel current operation + break + /datum/component/orbiter/proc/orbiter_move_react(atom/movable/orbiter, atom/oldloc, direction) if(orbiter.loc == get_turf(parent))