From d8316367159e31fde45eb4c716bb5a688e93f4b1 Mon Sep 17 00:00:00 2001 From: uraniummeltdown Date: Tue, 9 Jan 2018 23:18:22 +0500 Subject: [PATCH] fixes atmos machines not dropping frame and parts moves drying rack dropping wood out of Destroy() transfers fingerprints to dropped machine frame, halves obj_integrity of non-disassembled deconstructed pipes and machine frames --- code/ATMOSPHERICS/atmospherics.dm | 21 +++++++++++-------- code/game/machinery/machinery.dm | 15 ++++++++----- .../kitchen_machinery/smartfridge.dm | 4 ++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index f4538bb97e2..b2f58691818 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -187,7 +187,7 @@ Pipelines + Other Objects -> Pipe network //You unwrenched a pipe full of pressure? let's splat you into the wall silly. if(unsafe_wrenching) unsafe_pressure_release(user,internal_pressure) - deconstruct() + deconstruct(TRUE) else return ..() @@ -208,13 +208,16 @@ Pipelines + Other Objects -> Pipe network //Values based on 2*ONE_ATMOS (the unsafe pressure), resulting in 20 range and 4 speed user.throw_at(general_direction,pressures/10,pressures/50) -/obj/machinery/atmospherics/deconstruct() - if(can_unwrench) - stored.loc = get_turf(src) - transfer_fingerprints_to(stored) - stored = null - - qdel(src) +/obj/machinery/atmospherics/deconstruct(disassembled = TRUE) + if(can_deconstruct) + if(can_unwrench) + if(stored) + stored.forceMove(get_turf(src)) + if(!disassembled) + stored.obj_integrity = stored.max_integrity * 0.5 + transfer_fingerprints_to(stored) + stored = null + ..() /obj/machinery/atmospherics/on_construction(D, P, C) if(C) @@ -321,7 +324,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/singularity_pull(S, current_size) if(current_size >= STAGE_FIVE) - deconstruct() + deconstruct(FALSE) /obj/machinery/atmospherics/update_remote_sight(mob/user) user.sight |= (SEE_TURFS|BLIND) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 51a0b370a5d..8bdeb7059ca 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -404,14 +404,19 @@ Class Procs: return 0 /obj/machinery/deconstruct(disassembled = TRUE) - on_deconstruction() - spawn_frame() - for(var/obj/item/I in component_parts) - I.forceMove(loc) + if(can_deconstruct) + on_deconstruction() + if(component_parts && component_parts.len) + spawn_frame() + for(var/obj/item/I in component_parts) + I.forceMove(loc) qdel(src) -/obj/machinery/proc/spawn_frame() +/obj/machinery/proc/spawn_frame(disassembled) var/obj/machinery/constructable_frame/machine_frame/M = new /obj/machinery/constructable_frame/machine_frame(loc) + if(!disassembled) + M.obj_integrity = M.max_integrity * 0.5 //the frame is already half broken + transfer_fingerprints_to(M) M.state = 2 M.icon_state = "box_1" diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 6b8d9cebd26..966b5c3f4de 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -429,9 +429,9 @@ component_parts.Cut() component_parts = null -/obj/machinery/smartfridge/drying_rack/Destroy() +/obj/machinery/smartfridge/drying_rack/on_deconstruction() new /obj/item/stack/sheet/wood(loc, 10) - return ..() + ..() /obj/machinery/smartfridge/drying_rack/RefreshParts() return