From 5e17397a492032fd8a001b7890729afaa32d70b1 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Fri, 13 Jun 2025 16:56:12 -0400 Subject: [PATCH] fix undesirable spacedrift behavior (#29521) * fix undesirable spacedrift behavior * may not need this --- code/controllers/subsystem/movement/SSmovement.dm | 2 +- code/modules/mob/mob_movement.dm | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/controllers/subsystem/movement/SSmovement.dm b/code/controllers/subsystem/movement/SSmovement.dm index d6cad4a734d..26ffbe4d52d 100644 --- a/code/controllers/subsystem/movement/SSmovement.dm +++ b/code/controllers/subsystem/movement/SSmovement.dm @@ -104,7 +104,7 @@ SUBSYSTEM_DEF(movement) var/list/compare_item = list(loop.queued_time) BINARY_INSERT_DEFINE(new_bucket, sorted_buckets, SORT_VAR_NO_TYPE, compare_item, SORT_FIRST_INDEX, COMPARE_KEY) - our_bucket += loop + our_bucket |= loop /datum/controller/subsystem/movement/proc/dequeue_loop(datum/move_loop/loop) // Go home, you're not here anyway diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index d10218ad2d1..099d33c1d36 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -340,6 +340,7 @@ if(continuous_move || !istype(backup) || !movement_dir || backup.anchored) return TRUE + last_pushoff = world.time var/opposite_dir = turn(movement_dir, 180) if(backup.newtonian_move(opposite_dir)) //You're pushing off something movable, so it moves to_chat(src, "You push off of [backup] to propel yourself.") @@ -379,8 +380,12 @@ continue if(continuous_move && !pass_allowed) var/datum/move_loop/move/rebound_engine = GLOB.move_manager.processing_on(rebound, SSspacedrift) - // If you're moving toward it and you're both going the same direction, stop - if(moving_direction == get_dir(src, pushover) && rebound_engine && moving_direction == rebound_engine.direction) + // If us and the rebound object are both drifting in the same + // direction, we can't push off of it. We do not check + // get_dir(src, pushover) because two objects drifting in the same + // direction may potentially occupy the same turf at some point + // during processing. + if(rebound_engine && moving_direction == rebound_engine.direction) continue else if(!pass_allowed) if(moving_direction == get_dir(src, pushover)) // Can't push "off" of something that you're walking into