From ccc2c099dcd740cc7aaa2456017580061196414b Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Tue, 30 Apr 2013 06:18:54 -0400 Subject: [PATCH] Fixed some atmos machine New()'s not calling base's new at right time, and more importantly, initialize() selects new connections rather than aborting if previously connected, as the point of the initialize proc is for construction --- .../components/binary_devices/binary_atmos_base.dm | 9 ++++++++- code/ATMOSPHERICS/components/portables_connector.dm | 5 ++++- .../components/trinary_devices/filter.dm | 2 +- .../components/trinary_devices/trinary_base.dm | 13 ++++++++++++- code/ATMOSPHERICS/components/unary/unary_base.dm | 5 ++++- code/ATMOSPHERICS/components/unary/vent_pump.dm | 2 +- code/ATMOSPHERICS/components/unary/vent_scrubber.dm | 3 ++- code/ATMOSPHERICS/components/valve.dm | 2 +- 8 files changed, 33 insertions(+), 8 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 9d2a8e32e8a..3a23972ce70 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -60,7 +60,14 @@ obj/machinery/atmospherics/binary ..() initialize() - if(node1 && node2) return + if(node1) + node1.disconnect(src) + del(network1) + node1 = null + if(node2) + node2.disconnect(src) + del(network2) + node2 = null var/node2_connect = dir var/node1_connect = turn(dir, 180) diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index 9ecc82b3244..5a66f687867 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -77,7 +77,10 @@ ..() initialize() - if(node) return + if(node) + node.disconnect(src) + del(network) + node = null var/node_connect = dir diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 6a92f9a24bf..116e69893ec 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -34,9 +34,9 @@ Filter types: radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA) New() + ..() if(radio_controller) initialize() - ..() update_icon() if(stat & NOPOWER) diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index d3f1116a430..2078eca74b3 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -72,7 +72,18 @@ obj/machinery/atmospherics/trinary ..() initialize() - if(node1 && node2 && node3) return + if(node1) + node1.disconnect(src) + del(network1) + node1 = null + if(node2) + node2.disconnect(src) + del(network2) + node2 = null + if(node3) + node3.disconnect(src) + del(network3) + node3 = null var/node1_connect = turn(dir, -180) var/node2_connect = turn(dir, -90) diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index b755071487e..a697536b8dd 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -40,7 +40,10 @@ ..() initialize() - if(node) return + if(node) + node.disconnect(src) + del(network) + node = null var/node_connect = dir diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 67bf0688d9e..2c1ff603714 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -43,6 +43,7 @@ icon_state = "in" New() + ..() initial_loc = get_area(loc) if (initial_loc.master) initial_loc = initial_loc.master @@ -53,7 +54,6 @@ if(ticker && ticker.current_state == 3)//if the game is running src.initialize() src.broadcast_status() - ..() high_volume name = "Large Air Vent" diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 5da8ed0d964..346ed958a36 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -25,7 +25,9 @@ var/area_uid var/radio_filter_out var/radio_filter_in + New() + ..() initial_loc = get_area(loc) if (initial_loc.master) initial_loc = initial_loc.master @@ -36,7 +38,6 @@ if(ticker && ticker.current_state == 3)//if the game is running src.initialize() src.broadcast_status() - ..() update_icon() if(node && on && !(stat & (NOPOWER|BROKEN))) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 09d0b64f866..6350c955073 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -28,12 +28,12 @@ obj/machinery/atmospherics/valve icon_state = "valve[open]" New() + ..() switch(dir) if(NORTH || SOUTH) initialize_directions = NORTH|SOUTH if(EAST || WEST) initialize_directions = EAST|WEST - ..() network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)