From 637a51edd7d2ddc650ea97ffb6ea19b339cbf118 Mon Sep 17 00:00:00 2001 From: Atermonera Date: Sat, 8 Feb 2020 11:03:02 -0800 Subject: [PATCH 1/2] Merge pull request #6676 from Meghan-Rossi/machinefix Fix frame deconstruction bugs --- code/game/machinery/frame.dm | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/code/game/machinery/frame.dm b/code/game/machinery/frame.dm index 41c7a33a19..1331f5adb7 100644 --- a/code/game/machinery/frame.dm +++ b/code/game/machinery/frame.dm @@ -429,6 +429,7 @@ circuit = null if(frame_type.frame_class == FRAME_CLASS_MACHINE) req_components = null + update_desc() else if(state == FRAME_WIRED) if(frame_type.frame_class == FRAME_CLASS_MACHINE) @@ -498,27 +499,21 @@ else if(P.is_wirecutter()) if(state == FRAME_WIRED) - if(frame_type.frame_class == FRAME_CLASS_COMPUTER) + if( \ + frame_type.frame_class == FRAME_CLASS_COMPUTER || \ + frame_type.frame_class == FRAME_CLASS_DISPLAY || \ + frame_type.frame_class == FRAME_CLASS_ALARM || \ + frame_type.frame_class == FRAME_CLASS_MACHINE \ + ) playsound(src, P.usesound, 50, 1) - to_chat(user, "You remove the cables.") - state = FRAME_FASTENED - new /obj/item/stack/cable_coil(src.loc, 5) - - else if(frame_type.frame_class == FRAME_CLASS_DISPLAY) - playsound(src, P.usesound, 50, 1) - to_chat(user, "You remove the cables.") - state = FRAME_FASTENED - new /obj/item/stack/cable_coil(src.loc, 5) - - else if(frame_type.frame_class == FRAME_CLASS_ALARM) - playsound(src, P.usesound, 50, 1) - to_chat(user, "You remove the cables.") - state = FRAME_FASTENED - new /obj/item/stack/cable_coil(src.loc, 5) - - else if(frame_type.frame_class == FRAME_CLASS_MACHINE) - playsound(src, P.usesound, 50, 1) - to_chat(user, "You remove the cables.") + if (components.len == 0) + to_chat(user, "You remove the cables.") + else + to_chat(user, "You remove the cables and components.") + for(var/obj/item/weapon/W in components) + W.forceMove(src.loc) + check_components() + update_desc() state = FRAME_FASTENED new /obj/item/stack/cable_coil(src.loc, 5)