From 138cfd388fe1c277ef447a204cff0b56a7e069c3 Mon Sep 17 00:00:00 2001 From: Letter N <24603524+LetterN@users.noreply.github.com> Date: Wed, 10 Mar 2021 14:40:25 +0800 Subject: [PATCH] a --- code/game/machinery/_machinery.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index c7eaeb0f86..e37fd13106 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -361,11 +361,11 @@ Class Procs: /obj/machinery/deconstruct(disassembled = TRUE) if(!(flags_1 & NODECONSTRUCT_1)) on_deconstruction() - if(component_parts && component_parts.len) + if(LAZYLEN(component_parts)) spawn_frame(disassembled) for(var/obj/item/I in component_parts) I.forceMove(loc) - component_parts.Cut() + LAZYCLEARLIST(component_parts) qdel(src) /obj/machinery/proc/spawn_frame(disassembled) @@ -544,8 +544,8 @@ Class Procs: if (AM == occupant) SEND_SIGNAL(src, COMSIG_MACHINE_EJECT_OCCUPANT, occupant) occupant = null - if(AM == circuit) - LAZYREMOVE(component_parts, AM) + if(AM == circuit && circuit.loc != src) + component_parts -= AM //TODO: make the cmp part functions use lazyX circuit = null /obj/machinery/proc/adjust_item_drop_location(atom/movable/AM) // Adjust item drop location to a 3x3 grid inside the tile, returns slot id from 0 to 8