From 524a8dc0b4192b4f48610370d9b4b1ac99828f82 Mon Sep 17 00:00:00 2001 From: Adrer Date: Sat, 21 Jan 2023 20:13:06 +0100 Subject: [PATCH] Makes you unable to pull a surgical tray you are standing on (#20229) * No longer pull trays you are on. * Update code/game/objects/structures/tables_racks.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Update code/game/objects/structures/tables_racks.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * Remove unnecessary loop from can_be_pulled Co-authored-by: adrermail@gmail.com Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> --- code/game/objects/structures/tables_racks.dm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 68f415f675a..47e56e02af9 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -797,11 +797,25 @@ continue held.forceMove(NewLoc) +/obj/structure/table/tray/can_be_pulled(user, grab_state, force, show_message) + var/atom/movable/puller = user + if(loc != puller.loc) + held_items -= puller.UID() + if(isliving(user)) + var/mob/living/M = user + if(M.UID() in held_items) + return FALSE + return ..() + /obj/structure/table/tray/item_placed(atom/movable/item) . = ..() if(is_type_in_typecache(item, typecache_can_hold)) held_items += item.UID() - + if(isliving(item)) + var/mob/living/M = item + if(M.pulling == src) + M.stop_pulling() + /obj/structure/table/tray/deconstruct(disassembled = TRUE, wrench_disassembly = 0) if(!(flags & NODECONSTRUCT)) var/turf/T = get_turf(src)