From 0949b95e3a44e83a7165358347134f8a9c8de0eb Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:49:45 +0200 Subject: [PATCH] [MIRROR] [no gbp] Jump jets activate a linked jetpack in a more sensible way [MDB IGNORE] (#23685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [no gbp] Jump jets activate a linked jetpack in a more sensible way (#78296) ## About The Pull Request fikou pointed out that the code I wrote not only wasn't reliable on destroy but also was overengineered but only _after_ he merged it 😠 now we just ask the jetpack module if it is on rather than using a weird trait ## Changelog not player facing * [no gbp] Jump jets activate a linked jetpack in a more sensible way --------- Co-authored-by: Jacquerel --- code/__DEFINES/traits.dm | 2 -- code/datums/components/jetpack.dm | 4 ---- code/modules/mod/modules/modules_general.dm | 7 +++---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index bd9365dc736..ade8a05798f 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -639,8 +639,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_MOVE_PHASING "move_phasing" /// Disables the floating animation. See above. #define TRAIT_NO_FLOATING_ANIM "no-floating-animation" -/// Trait applied while you're using a jetpack -#define TRAIT_JETPACKING "using_a_jetpack" /// Weather immunities, also protect mobs inside them. #define TRAIT_LAVA_IMMUNE "lava_immune" //Used by lava turfs and The Floor Is Lava. diff --git a/code/datums/components/jetpack.dm b/code/datums/components/jetpack.dm index f21b6a5eebf..f7e1fca70e6 100644 --- a/code/datums/components/jetpack.dm +++ b/code/datums/components/jetpack.dm @@ -84,8 +84,6 @@ if(!check_on_move.Invoke(TRUE)) return return_flag - ADD_TRAIT(user, TRAIT_JETPACKING, REF(src)) - RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(move_react)) RegisterSignal(user, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(pre_move_react)) RegisterSignal(user, COMSIG_MOVABLE_SPACEMOVE, PROC_REF(spacemove_react)) @@ -97,8 +95,6 @@ /datum/component/jetpack/proc/deactivate(datum/source, mob/user) SIGNAL_HANDLER - REMOVE_TRAIT(user, TRAIT_JETPACKING, REF(src)) - UnregisterSignal(user, COMSIG_MOVABLE_MOVED) UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE) UnregisterSignal(user, COMSIG_MOVABLE_SPACEMOVE) diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index e0794511396..6d47a5b60ba 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -209,10 +209,9 @@ launch_from.visible_message(span_warning("[mod.wearer] rockets into the air!")) new /obj/effect/temp_visual/jet_plume(launch_from) - if (!HAS_TRAIT(mod.wearer, TRAIT_JETPACKING)) - var/obj/item/mod/module/jetpack/linked_jetpack = locate() in mod.modules - if (!isnull(linked_jetpack)) - linked_jetpack.on_activation() + var/obj/item/mod/module/jetpack/linked_jetpack = locate() in mod.modules + if (!isnull(linked_jetpack) && !linked_jetpack.active) + linked_jetpack.on_activation() return TRUE #undef FAILED_ACTIVATION_COOLDOWN