From 543add7c10fddbcbc595451e5467a2288027357e Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 24 Apr 2017 03:42:50 -0400 Subject: [PATCH] Initial Commit --- code/ATMOSPHERICS/atmospherics.dm | 3 +- .../binary_devices/binary_atmos_base.dm | 2 +- .../components/binary_devices/circulator.dm | 2 +- .../components/binary_devices/dp_vent_pump.dm | 5 +- .../components/binary_devices/passive_gate.dm | 5 +- .../components/binary_devices/pump.dm | 5 +- .../components/binary_devices/volume_pump.dm | 5 +- .../components/omni_devices/filter.dm | 5 +- .../components/omni_devices/mixer.dm | 5 +- .../components/omni_devices/omni_base.dm | 4 +- .../components/trinary_devices/filter.dm | 5 +- .../components/trinary_devices/mixer.dm | 5 +- .../trinary_devices/trinary_base.dm | 2 +- .../components/unary_devices/cold_sink.dm | 7 +-- .../unary_devices/heat_exchanger.dm | 5 +- .../components/unary_devices/heat_source.dm | 5 +- .../unary_devices/outlet_injector.dm | 7 ++- .../unary_devices/oxygen_generator.dm | 5 +- .../components/unary_devices/passive_vent.dm | 5 +- .../unary_devices/portables_connector.dm | 5 +- .../components/unary_devices/thermal_plate.dm | 5 +- .../components/unary_devices/unary_base.dm | 2 +- .../components/unary_devices/vent_pump.dm | 5 +- .../components/unary_devices/vent_scrubber.dm | 5 +- code/ATMOSPHERICS/pipes/cap.dm | 3 +- code/ATMOSPHERICS/pipes/manifold.dm | 2 +- code/ATMOSPHERICS/pipes/manifold4w.dm | 2 +- .../pipes/simple/pipe_simple_he.dm | 2 +- code/_globalvars/lists/objects.dm | 1 + code/controllers/Processes/air.dm | 46 +++++++++++++++++++ code/controllers/Processes/pipenet.dm | 33 ------------- code/game/machinery/atmo_control.dm | 4 +- code/game/machinery/atmoalter/canister.dm | 2 +- code/game/machinery/atmoalter/meter.dm | 4 +- .../atmoalter/portable_atmospherics.dm | 4 +- code/game/machinery/atmoalter/pump.dm | 2 +- code/game/machinery/atmoalter/scrubber.dm | 2 +- code/game/machinery/atmoalter/zvent.dm | 10 +++- code/game/machinery/cryo.dm | 13 ++++-- code/game/machinery/machinery.dm | 3 ++ paradise.dme | 1 - 41 files changed, 144 insertions(+), 99 deletions(-) delete mode 100644 code/controllers/Processes/pipenet.dm diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 6f1be49b3b7..f45a275987f 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -33,7 +33,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/New() ..() - + atmos_machinery += src if(!icon_manager) icon_manager = new() @@ -54,6 +54,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/Destroy() QDEL_NULL(stored) + atmos_machinery -= src for(var/mob/living/L in src) //ventcrawling is serious business L.remove_ventcrawl() L.forceMove(get_turf(src)) diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 8951977d4db..d19c95d6a66 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -147,6 +147,6 @@ T.assume_air(to_release) air_update_turf(1) -/obj/machinery/atmospherics/binary/process() +/obj/machinery/atmospherics/binary/process_atmos() ..() return parent1 && parent2 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index a0f563669c1..403f9759ac6 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -70,7 +70,7 @@ else last_pressure_delta = 0 -/obj/machinery/atmospherics/binary/circulator/process() +/obj/machinery/atmospherics/binary/circulator/process_atmos() ..() update_icon() diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index 74293d6a807..d36c6059c5f 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -104,8 +104,9 @@ else add_underlay(T, node2, dir) -/obj/machinery/atmospherics/binary/dp_vent_pump/process() - if(!..() || !on) +/obj/machinery/atmospherics/binary/dp_vent_pump/process_atmos() + ..() + if(!on) return 0 var/datum/gas_mixture/environment = loc.return_air() diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index a9071e5ba13..e4e4464b55f 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -33,8 +33,9 @@ add_underlay(T, node1, turn(dir, 180)) add_underlay(T, node2, dir) -/obj/machinery/atmospherics/binary/passive_gate/process() - if(!..() || !on) +/obj/machinery/atmospherics/binary/passive_gate/process_atmos() + ..() + if(!on) return 0 var/output_starting_pressure = air2.return_pressure() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 908a5318dda..8b36352700c 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -53,8 +53,9 @@ Thus, the two variables affect pump operation are set in New(): add_underlay(T, node1, turn(dir, -180)) add_underlay(T, node2, dir) -/obj/machinery/atmospherics/binary/pump/process() - if(!..() || (stat & (NOPOWER|BROKEN)) || !on) +/obj/machinery/atmospherics/binary/pump/process_atmos() + ..() + if((stat & (NOPOWER|BROKEN)) || !on) return 0 var/output_starting_pressure = air2.return_pressure() diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index 0ec613cb049..334e632f1df 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -51,8 +51,9 @@ Thus, the two variables affect pump operation are set in New(): add_underlay(T, node1, turn(dir, -180)) add_underlay(T, node2, dir) -/obj/machinery/atmospherics/binary/volume_pump/process() - if(!..() || (stat & (NOPOWER|BROKEN)) || !on) +/obj/machinery/atmospherics/binary/volume_pump/process_atmos() + ..() + if((stat & (NOPOWER|BROKEN)) || !on) return 0 // Pump mechanism just won't do anything if the pressure is too high/too low diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm index cbe1422c38a..ce0089b0639 100644 --- a/code/ATMOSPHERICS/components/omni_devices/filter.dm +++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm @@ -42,8 +42,9 @@ return 0 -/obj/machinery/atmospherics/omni/filter/process() - if(!..() || !on) +/obj/machinery/atmospherics/omni/filter/process_atmos() + ..() + if(!on) return 0 if(!input || !output) diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm index 07269c5f3db..0676d833029 100644 --- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm @@ -83,8 +83,9 @@ return 0 -/obj/machinery/atmospherics/omni/mixer/process() - if(!..() || !on) +/obj/machinery/atmospherics/omni/mixer/process_atmos() + ..() + if(!on) return 0 var/datum/gas_mixture/output_air = output.air diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index a247d6f93a3..ed3e6836fc9 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -128,7 +128,7 @@ /obj/machinery/atmospherics/omni/attack_ghost(mob/user) ui_interact(user) - + /obj/machinery/atmospherics/omni/proc/build_icons() if(!check_icon_cache()) return @@ -293,7 +293,7 @@ P.parent = New -/obj/machinery/atmospherics/omni/process() +/obj/machinery/atmospherics/omni/process_atmos() ..() for(var/datum/omni_port/port in ports) if(!port.parent) diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 109c3a2fa04..7ec310f2642 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -68,8 +68,9 @@ Filter types: if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/trinary/filter/process() - if(!..() || !on) +/obj/machinery/atmospherics/trinary/filter/process_atmos() + ..() + if(!on) return 0 var/output_starting_pressure = air3.return_pressure() diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 0657f8d9f5f..8d388d478dd 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -56,8 +56,9 @@ ..() air3.volume = 300 -/obj/machinery/atmospherics/trinary/mixer/process() - if(!..() || !on) +/obj/machinery/atmospherics/trinary/mixer/process_atmos() + ..() + if(!on) return 0 var/output_starting_pressure = air3.return_pressure() diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 47cfb15fa51..6dc5e5cc303 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -206,6 +206,6 @@ T.assume_air(to_release) air_update_turf(1) -/obj/machinery/atmospherics/trinary/process() +/obj/machinery/atmospherics/trinary/process_atmos() ..() return parent1 && parent2 && parent3 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm b/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm index 3e716d6f1cb..39441f8ed87 100644 --- a/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary_devices/cold_sink.dm @@ -22,10 +22,11 @@ return -/obj/machinery/atmospherics/unary/cold_sink/process() - if(!..() || !on) +/obj/machinery/atmospherics/unary/cold_sink/process_atmos() + ..() + if(!on) return 0 - + var/air_heat_capacity = air_contents.heat_capacity() var/combined_heat_capacity = current_heat_capacity + air_heat_capacity var/old_temperature = air_contents.temperature diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm index 8b871847b23..1b726a6c066 100644 --- a/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary_devices/heat_exchanger.dm @@ -32,9 +32,8 @@ ..() -/obj/machinery/atmospherics/unary/heat_exchanger/process() - if(!..()) - return 0 +/obj/machinery/atmospherics/unary/heat_exchanger/process_atmos() + ..() if(!partner) return 0 diff --git a/code/ATMOSPHERICS/components/unary_devices/heat_source.dm b/code/ATMOSPHERICS/components/unary_devices/heat_source.dm index 13b3b239986..2b0cbc14277 100644 --- a/code/ATMOSPHERICS/components/unary_devices/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary_devices/heat_source.dm @@ -22,8 +22,9 @@ return -/obj/machinery/atmospherics/unary/heat_reservoir/process() - if(!..() || !on) +/obj/machinery/atmospherics/unary/heat_reservoir/process_atmos() + ..() + if(!on) return 0 var/air_heat_capacity = air_contents.heat_capacity() var/combined_heat_capacity = current_heat_capacity + air_heat_capacity diff --git a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm index f30ca5a016c..63070b19538 100644 --- a/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary_devices/outlet_injector.dm @@ -51,10 +51,9 @@ if(old_stat != stat) update_icon() -/obj/machinery/atmospherics/unary/outlet_injector/process() - if(!..()) - return 0 - +/obj/machinery/atmospherics/unary/outlet_injector/process_atmos() + ..() + injecting = 0 if(!on || stat & NOPOWER) diff --git a/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm index 274f9999edb..0f575fb9c3a 100644 --- a/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm +++ b/code/ATMOSPHERICS/components/unary_devices/oxygen_generator.dm @@ -28,8 +28,9 @@ air_contents.volume = 50 -/obj/machinery/atmospherics/unary/oxygen_generator/process() - if(!..() || !on) +/obj/machinery/atmospherics/unary/oxygen_generator/process_atmos() + ..() + if(!on) return 0 var/total_moles = air_contents.total_moles() diff --git a/code/ATMOSPHERICS/components/unary_devices/passive_vent.dm b/code/ATMOSPHERICS/components/unary_devices/passive_vent.dm index 5deec7925b9..4078f5412c2 100644 --- a/code/ATMOSPHERICS/components/unary_devices/passive_vent.dm +++ b/code/ATMOSPHERICS/components/unary_devices/passive_vent.dm @@ -17,9 +17,8 @@ ..() air_contents.volume = volume -/obj/machinery/atmospherics/unary/passive_vent/process() - if(!..()) - return 0 +/obj/machinery/atmospherics/unary/passive_vent/process_atmos() + ..() if(!node) return 0 diff --git a/code/ATMOSPHERICS/components/unary_devices/portables_connector.dm b/code/ATMOSPHERICS/components/unary_devices/portables_connector.dm index db76b56cac0..f2243760dd5 100644 --- a/code/ATMOSPHERICS/components/unary_devices/portables_connector.dm +++ b/code/ATMOSPHERICS/components/unary_devices/portables_connector.dm @@ -28,8 +28,9 @@ return add_underlay(T, node, dir) -/obj/machinery/atmospherics/unary/portables_connector/process() - if(!..() || !connected_device) +/obj/machinery/atmospherics/unary/portables_connector/process_atmos() + ..() + if(!connected_device) return 0 parent.update = 1 diff --git a/code/ATMOSPHERICS/components/unary_devices/thermal_plate.dm b/code/ATMOSPHERICS/components/unary_devices/thermal_plate.dm index dc7da589017..c245bfc120e 100644 --- a/code/ATMOSPHERICS/components/unary_devices/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary_devices/thermal_plate.dm @@ -17,9 +17,8 @@ prefix="h" icon_state = "[prefix]off" -/obj/machinery/atmospherics/unary/thermal_plate/process() - if(!..()) - return 0 +/obj/machinery/atmospherics/unary/thermal_plate/process_atmos() + ..() var/datum/gas_mixture/environment = loc.return_air() diff --git a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm index e61a62736c3..bcdf6c51903 100644 --- a/code/ATMOSPHERICS/components/unary_devices/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary_devices/unary_base.dm @@ -99,6 +99,6 @@ T.assume_air(to_release) air_update_turf(1) -/obj/machinery/atmospherics/unary/process() +/obj/machinery/atmospherics/unary/process_atmos() ..() return parent \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm index 08febf1c572..942082a3143 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_pump.dm @@ -121,8 +121,9 @@ update_icon() update_underlays() -/obj/machinery/atmospherics/unary/vent_pump/process() - if(!..() || (stat & (NOPOWER|BROKEN))) +/obj/machinery/atmospherics/unary/vent_pump/process_atmos() + ..() + if((stat & (NOPOWER|BROKEN))) return 0 if(!node) on = 0 diff --git a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm index 6747b103972..0a0b865d66b 100644 --- a/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm @@ -175,9 +175,8 @@ src.broadcast_status() check_turfs() -/obj/machinery/atmospherics/unary/vent_scrubber/process() - if(!..()) - return 0 +/obj/machinery/atmospherics/unary/vent_scrubber/process_atmos() + ..() if(widenet) check_turfs() diff --git a/code/ATMOSPHERICS/pipes/cap.dm b/code/ATMOSPHERICS/pipes/cap.dm index 0504062eb09..7691b157857 100644 --- a/code/ATMOSPHERICS/pipes/cap.dm +++ b/code/ATMOSPHERICS/pipes/cap.dm @@ -25,11 +25,12 @@ /obj/machinery/atmospherics/pipe/cap/pipeline_expansion() return list(node) -/obj/machinery/atmospherics/pipe/cap/process() +/obj/machinery/atmospherics/pipe/cap/process_atmos() if(!parent) ..() else . = PROCESS_KILL + /obj/machinery/atmospherics/pipe/cap/Destroy() . = ..() if(node) diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 0c3e5fd5be3..dc8dbeca381 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -66,7 +66,7 @@ /obj/machinery/atmospherics/pipe/manifold/pipeline_expansion() return list(node1, node2, node3) -/obj/machinery/atmospherics/pipe/manifold/process() +/obj/machinery/atmospherics/pipe/manifold/process_atmos() if(!parent) ..() else diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index c00696ed1a9..1b03b12fe2a 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -25,7 +25,7 @@ /obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion() return list(node1, node2, node3, node4) -/obj/machinery/atmospherics/pipe/manifold4w/process() +/obj/machinery/atmospherics/pipe/manifold4w/process_atmos() if(!parent) ..() else diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm index a771bdd6234..26139b40606 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm @@ -13,7 +13,7 @@ buckle_lying = 1 var/icon_temperature = T20C //stop small changes in temperature causing icon refresh -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process() +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process_atmos() var/environment_temperature = 0 var/datum/gas_mixture/pipe_air = return_air() if(!pipe_air) diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 0cc712799c7..cb1ce8f10a7 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -19,6 +19,7 @@ var/global/list/all_areas = list() var/global/list/machines = list() var/global/list/machine_processing = list() var/global/list/fast_processing = list() +var/global/list/atmos_machinery = list() var/global/list/processing_power_items = list() //items that ask to be called every cycle var/global/list/rcd_list = list() //list of Rapid Construction Devices. diff --git a/code/controllers/Processes/air.dm b/code/controllers/Processes/air.dm index 311699bb720..7b35eae7aad 100644 --- a/code/controllers/Processes/air.dm +++ b/code/controllers/Processes/air.dm @@ -38,6 +38,8 @@ var/global/datum/controller/process/air_system/air_master if(kill_air) return 1 current_cycle++ + process_pipenets() + process_atmos_machinery() process_active_turfs() process_excited_groups() process_high_pressure_delta() @@ -49,6 +51,8 @@ var/global/datum/controller/process/air_system/air_master ..() stat(null, "[last_active] active") stat(null, "[last_excited] EG | [last_hpd] HPD | [last_asc] ASC | [last_hotspots] Hot") + stat(null, "[pipe_networks.len] pipe nets, [deferred_pipenet_rebuilds.len] deferred") + stat(null, "[atmos_machinery.len] atmos machines") DECLARE_GLOBAL_CONTROLLER(air_system, air_master) @@ -78,6 +82,48 @@ DECLARE_GLOBAL_CONTROLLER(air_system, air_master) T.process_cell() SCHECK +/datum/controller/process/air_system/proc/process_pipenets() + for(last_object in deferred_pipenet_rebuilds) + var/obj/machinery/atmospherics/M = last_object + if(istype(M) && isnull(M.gcDestroyed)) + try + M.build_network() + catch(var/exception/e) + catchException(e, M) + SCHECK + else + catchBadType(M) + deferred_pipenet_rebuilds -= M + + for(last_object in pipe_networks) + var/datum/pipeline/pipeNetwork = last_object + if(istype(pipeNetwork) && isnull(pipeNetwork.gcDestroyed)) + try + pipeNetwork.process() + catch(var/exception/e) + catchException(e, pipeNetwork) + SCHECK + else + catchBadType(pipeNetwork) + pipe_networks -= pipeNetwork + +/datum/controller/process/air_system/proc/process_atmos_machinery() + for(last_object in atmos_machinery) + var/obj/machinery/M = last_object + if(istype(M) && isnull(M.gcDestroyed)) + try + if(M.process_atmos() == PROCESS_KILL) + atmos_machinery.Remove(M) + continue + catch(var/exception/e) + catchException(e, M) + else + catchBadType(M) + atmos_machinery -= M + + SCHECK + + /datum/controller/process/air_system/proc/remove_from_active(var/turf/simulated/T) if(istype(T)) T.excited = 0 diff --git a/code/controllers/Processes/pipenet.dm b/code/controllers/Processes/pipenet.dm deleted file mode 100644 index 5706fa8326e..00000000000 --- a/code/controllers/Processes/pipenet.dm +++ /dev/null @@ -1,33 +0,0 @@ -/datum/controller/process/pipenet/setup() - name = "pipenet" - schedule_interval = 20 // every 2 seconds - start_delay = 18 - -/datum/controller/process/pipenet/statProcess() - ..() - stat(null, "[pipe_networks.len] pipe nets, [deferred_pipenet_rebuilds.len] deferred") - -/datum/controller/process/pipenet/doWork() - for(last_object in deferred_pipenet_rebuilds) - var/obj/machinery/atmospherics/M = last_object - if(istype(M) && isnull(M.gcDestroyed)) - try - M.build_network() - catch(var/exception/e) - catchException(e, M) - SCHECK - else - catchBadType(M) - deferred_pipenet_rebuilds -= M - - for(last_object in pipe_networks) - var/datum/pipeline/pipeNetwork = last_object - if(istype(pipeNetwork) && isnull(pipeNetwork.gcDestroyed)) - try - pipeNetwork.process() - catch(var/exception/e) - catchException(e, pipeNetwork) - SCHECK - else - catchBadType(pipeNetwork) - pipe_networks -= pipeNetwork diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 91687844329..62996473291 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -85,7 +85,7 @@ obj/machinery/air_sensor if(..()) return 1 - process() + process_atmos() if(on) if(!radio_connection) return @@ -129,9 +129,11 @@ obj/machinery/air_sensor initialize() ..() + atmos_machinery += src set_frequency(frequency) Destroy() + atmos_machinery -= src if(radio_controller) radio_controller.remove_object(src,frequency) return ..() diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm index b785297bd06..8057c6edf23 100644 --- a/code/game/machinery/atmoalter/canister.dm +++ b/code/game/machinery/atmoalter/canister.dm @@ -269,7 +269,7 @@ update_flag else return 1 -/obj/machinery/portable_atmospherics/canister/process() +/obj/machinery/portable_atmospherics/canister/process_atmos() if(destroyed) return diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 231a50bf802..d3f1f25a52d 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -18,12 +18,14 @@ /obj/machinery/meter/New() ..() + atmos_machinery += src target = locate(/obj/machinery/atmospherics/pipe) in loc if(id && !id_tag)//i'm not dealing with further merge conflicts, fuck it id_tag = id return 1 /obj/machinery/meter/Destroy() + atmos_machinery -= src target = null return ..() @@ -32,7 +34,7 @@ if(!target) target = locate(/obj/machinery/atmospherics/pipe) in loc -/obj/machinery/meter/process() +/obj/machinery/meter/process_atmos() if(!target) icon_state = "meterX" return 0 diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index 44ac6caf479..45dcb5f7880 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -13,6 +13,7 @@ /obj/machinery/portable_atmospherics/New() ..() + atmos_machinery += src air_contents.volume = volume air_contents.temperature = T20C @@ -27,7 +28,7 @@ connect(port) update_icon() -/obj/machinery/portable_atmospherics/process() +/obj/machinery/portable_atmospherics/process_atmos() if(!connected_port) //only react when pipe_network will ont it do it for you //Allow for reactions air_contents.react() @@ -35,6 +36,7 @@ update_icon() /obj/machinery/portable_atmospherics/Destroy() + atmos_machinery -= src disconnect() QDEL_NULL(air_contents) QDEL_NULL(holding) diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm index acdb4d30aa0..4fca317bf0d 100644 --- a/code/game/machinery/atmoalter/pump.dm +++ b/code/game/machinery/atmoalter/pump.dm @@ -46,7 +46,7 @@ ..(severity) -/obj/machinery/portable_atmospherics/pump/process() +/obj/machinery/portable_atmospherics/pump/process_atmos() ..() if(on) var/datum/gas_mixture/environment diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm index 2d714606610..17f671d9cc8 100644 --- a/code/game/machinery/atmoalter/scrubber.dm +++ b/code/game/machinery/atmoalter/scrubber.dm @@ -41,7 +41,7 @@ return -/obj/machinery/portable_atmospherics/scrubber/process() +/obj/machinery/portable_atmospherics/scrubber/process_atmos() ..() if(!on) diff --git a/code/game/machinery/atmoalter/zvent.dm b/code/game/machinery/atmoalter/zvent.dm index e3ac09e8f09..a9d288fe37e 100644 --- a/code/game/machinery/atmoalter/zvent.dm +++ b/code/game/machinery/atmoalter/zvent.dm @@ -9,7 +9,15 @@ var/on = 0 var/volume_rate = 800 -/obj/machinery/zvent/process() +/obj/machinery/zvent/New() + ..() + atmos_machinery += src + +/obj/machinery/zvent/Destroy() + atmos_machinery -= src + return ..() + +/obj/machinery/zvent/process_atmos() //all this object does, is make its turf share air with the ones above and below it, if they have a vent too. if(istype(loc,/turf/simulated)) //if we're not on a valid turf, forget it diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 8e026cfd80a..938011c1fc8 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -126,6 +126,15 @@ on = 0 go_out() playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) + + if(air_contents) + if(occupant) + process_occupant() + + return 1 + +/obj/machinery/atmospherics/unary/cryo_cell/process_atmos() + ..() if(!node) return if(!on) @@ -135,13 +144,9 @@ temperature_archived = air_contents.temperature heat_gas_contents() - if(occupant) - process_occupant() if(abs(temperature_archived-air_contents.temperature) > 1) parent.update = 1 - return 1 - /obj/machinery/atmospherics/unary/cryo_cell/allow_drop() return 0 diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 901ea27a7df..b8244771de0 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -166,6 +166,9 @@ Class Procs: /obj/machinery/process() // If you dont use process or power why are you here return PROCESS_KILL +/obj/machinery/proc/process_atmos() //If you dont use process why are you here + return PROCESS_KILL + /obj/machinery/emp_act(severity) if(use_power && stat == 0) use_power(7500/severity) diff --git a/paradise.dme b/paradise.dme index 7922492f099..80e920200f5 100644 --- a/paradise.dme +++ b/paradise.dme @@ -187,7 +187,6 @@ #include "code\controllers\Processes\npcai.dm" #include "code\controllers\Processes\npcpool.dm" #include "code\controllers\Processes\obj.dm" -#include "code\controllers\Processes\pipenet.dm" #include "code\controllers\Processes\shuttles.dm" #include "code\controllers\Processes\spacedrift.dm" #include "code\controllers\Processes\sun.dm"