From 1bd4d1d1feb2eb594b350ff7c6f73a59e9dc8fb6 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 1 Mar 2023 07:54:33 +0100 Subject: [PATCH] [MIRROR] Fixes taking items from storage in hyperspace [MDB IGNORE] (#19375) * Fixes taking items from storage in hyperspace (#73428) Taking items from storages actually puts it on the floor and then in your hands, which isnt really caught by movement signals. So deletes the hyperspace component on item pickup closes #72727 :cl: fix: fixes taking items from inventories glitching out in hyperspace /:cl: * Fixes taking items from storage in hyperspace --------- Co-authored-by: Time-Green --- code/datums/components/shuttle_cling.dm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/datums/components/shuttle_cling.dm b/code/datums/components/shuttle_cling.dm index 94f226ef7da..7f37933ae1f 100644 --- a/code/datums/components/shuttle_cling.dm +++ b/code/datums/components/shuttle_cling.dm @@ -39,6 +39,10 @@ RegisterSignals(parent, list(COMSIG_MOVABLE_MOVED, COMSIG_MOVABLE_UNBUCKLE, COMSIG_ATOM_NO_LONGER_PULLED), PROC_REF(update_state)) + //Items have this cool thing where they're first put on the floor if you grab them from storage, and then into your hand, which isn't caught by movement signals that well + if(isitem(parent)) + RegisterSignal(parent, COMSIG_ITEM_PICKUP, PROC_REF(do_remove)) + hyperloop = SSmove_manager.move(moving = parent, direction = direction, delay = not_clinging_move_delay, subsystem = SShyperspace_drift, priority = MOVEMENT_ABOVE_SPACE_PRIORITY, flags = MOVEMENT_LOOP_NO_DIR_UPDATE) update_state(parent) //otherwise we'll get moved 1 tile before we can correct ourselves, which isnt super bad but just looks jank @@ -146,6 +150,12 @@ return TRUE return FALSE +///This is just for signals and doesn't run for most removals, so dont add behaviour here expecting it to do much +/datum/component/shuttle_cling/proc/do_remove() + SIGNAL_HANDLER + + qdel(src) + /datum/component/shuttle_cling/Destroy(force, silent) REMOVE_TRAIT(parent, TRAIT_HYPERSPACED, src) QDEL_NULL(hyperloop)