From 6c38283707c7b482eeb6efebe30b67569e66d299 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Tue, 1 Oct 2024 13:10:04 -0400 Subject: [PATCH] fix: handle resizing shelf items from non-player movement (#26940) --- code/datums/components/shelved.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/datums/components/shelved.dm b/code/datums/components/shelved.dm index 86692d7b6b1..29ba697d01b 100644 --- a/code/datums/components/shelved.dm +++ b/code/datums/components/shelved.dm @@ -227,6 +227,7 @@ /datum/component/shelved/RegisterWithParent() . = ..() RegisterSignal(parent, COMSIG_ITEM_PICKUP, PROC_REF(on_item_pickup)) + RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_movable_moved)) var/obj/shelf = locateUID(shelf_uid) if(shelf) RegisterSignal(shelf, COMSIG_MOVABLE_SHOVE_IMPACT, PROC_REF(on_movable_shove_impact)) @@ -241,6 +242,11 @@ SIGNAL_HANDLER // COMSIG_ITEM_PICKUP qdel(src) +/// Generic handler for if anything moves us off our original shelf position, such as atmos pressure. +/datum/component/shelved/proc/on_movable_moved() + SIGNAL_HANDLER // COMSIG_MOVABLE_MOVED + qdel(src) + /datum/component/shelved/UnregisterFromParent() . = ..() var/obj/O = parent