From f08062f566ac37c7f303da76ef11f85ee89fd50e Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Sat, 17 Oct 2015 19:53:21 -0400 Subject: [PATCH] Reduces Round-start Atmos Processing: Full Charge Disposals --- code/modules/recycling/disposal.dm | 32 ++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 85df3a99be7..ce5ca78ebe0 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -29,18 +29,21 @@ // find the attached trunk (if present) and init gas resvr. /obj/machinery/disposal/New() ..() - spawn(5) - trunk = locate() in src.loc - if(!trunk) - mode = 0 - flush = 0 - else - trunk.linked = src // link the pipe trunk to self + trunk_check() - air_contents = new/datum/gas_mixture() - //gas.volume = 1.05 * CELLSTANDARD - update() + air_contents = new/datum/gas_mixture() + //gas.volume = 1.05 * CELLSTANDARD + update() +/obj/machinery/disposal/proc/trunk_check() + trunk = locate() in src.loc + if(!trunk) + mode = 0 + flush = 0 + else + mode = initial(mode) + flush = initial(flush) + trunk.linked = src // link the pipe trunk to self /obj/machinery/disposal/Destroy() eject() @@ -48,6 +51,15 @@ trunk.linked = null return ..() +/obj/machinery/disposal/initialize() + // this will get a copy of the air turf and take a SEND PRESSURE amount of air from it + var/atom/L = loc + var/datum/gas_mixture/env = new + env.copy_from(L.return_air()) + var/datum/gas_mixture/removed = env.remove(SEND_PRESSURE + 1) + air_contents.merge(removed) + trunk_check() + // attack by item places it in to disposal /obj/machinery/disposal/attackby(var/obj/item/I, var/mob/user, params) if(stat & BROKEN || !I || !user || ((I.flags & NODROP) && !istype(I, /obj/item/weapon/storage/bag/trash/cyborg)))