From 0d71bd9daf992a76dcf4fcb3cc474f8c26344b8f Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Sat, 6 Jun 2026 11:43:56 -0500 Subject: [PATCH] Fix moth flight in space (#96353) ## About The Pull Request Fixes #96344 The `if(!continuous_move && movement_dir)` did not respect whether the "jetpack" was usable or not, allowing you to free-float regardless of context. I wrapped them in the same check and it seems to work fine in both contexts (stabilizers on or actively moving). I presume this affected more than just moth wings (empty jetpacks, probably) but I'm not going to check ## Changelog :cl: Melbert fix: Fix moths being able to fly in space /:cl: --- code/datums/components/jetpack.dm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/code/datums/components/jetpack.dm b/code/datums/components/jetpack.dm index 3ebc9da823f..1ca91a9cb2e 100644 --- a/code/datums/components/jetpack.dm +++ b/code/datums/components/jetpack.dm @@ -136,13 +136,22 @@ if(source.client.intended_direction && check_on_move.Invoke(TRUE)) //You use jet when press keys. yes. trail?.generate_effect() +/// Handles all active 0g movement, including both manual (trying to move a direction in 0g) and automatic (drifting idly in 0g) /datum/component/jetpack/proc/stabilize(mob/source, movement_dir, continuous_move, backup) SIGNAL_HANDLER - if(!continuous_move && movement_dir) - return COMSIG_MOVABLE_STOP_SPACEMOVE - // Check if we have the fuel to stop this. Do NOT consume any fuel, just check - // This is done because things other then us can use our fuel - if(stabilize && check_on_move.Invoke(FALSE)) + /* + * Checks if we should stop any active movement + * + * Obviously we stop all forms of drifting if we have stabilizers active (allowing free space movement) + * Less obviously, we stop need to stop drift if we are trying to move *while passively drifting* + * (Without checking the latter, jetpacks will act very weird and jank. As you move in one direction, + * you will simultaneously drift in that direction, causing you to jump/skip a tile every so often.) + * + * Either way, we need to check that we have the "fuel" to stop this + * DO NOT CONSUME FUEL HERE, just check if we have it + * This is done because things other then us can use our fuel + */ + if((stabilize || (!continuous_move && movement_dir)) && check_on_move.Invoke(FALSE)) return COMSIG_MOVABLE_STOP_SPACEMOVE return NONE