mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Defers pipenet and powernet rebuilds upon destruction of pipes and cables so explosions are faster
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
var/obj/machinery/atmospherics/node1
|
||||
var/obj/machinery/atmospherics/node2
|
||||
|
||||
|
||||
var/datum/pipeline/parent1
|
||||
var/datum/pipeline/parent2
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
initialize_directions = EAST|WEST
|
||||
if(WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
|
||||
|
||||
air1 = new
|
||||
air2 = new
|
||||
|
||||
@@ -89,6 +89,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/binary/nullifyPipenet(datum/pipeline/P)
|
||||
..()
|
||||
if(!P)
|
||||
return
|
||||
if(P == parent1)
|
||||
parent1.other_airs -= air1
|
||||
parent1 = null
|
||||
@@ -128,7 +130,7 @@
|
||||
parent1 = New
|
||||
else if(Old == parent2)
|
||||
parent2 = New
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/unsafe_pressure_release(var/mob/user,var/pressures)
|
||||
..()
|
||||
|
||||
@@ -144,4 +146,7 @@
|
||||
to_release.merge(air2.remove(shared_loss))
|
||||
T.assume_air(to_release)
|
||||
air_update_turf(1)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/process()
|
||||
..()
|
||||
return parent1 && parent2
|
||||
@@ -48,7 +48,8 @@
|
||||
return removed
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/process()
|
||||
..()
|
||||
if(!..())
|
||||
return 0
|
||||
if(last_worldtime_transfer < world.time - 50)
|
||||
recent_moles_transferred = 0
|
||||
update_icon()
|
||||
|
||||
@@ -32,19 +32,19 @@
|
||||
//1: Do not pass external_pressure_bound
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/New()
|
||||
..()
|
||||
if (!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
icon = null
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "large dual port air vent"
|
||||
|
||||
@@ -103,9 +103,7 @@
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/process()
|
||||
..()
|
||||
|
||||
if(!on)
|
||||
if(!..() || !on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
@@ -236,7 +234,7 @@
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/multitool_menu(var/mob/user,var/obj/item/device/multitool/P)
|
||||
@@ -254,5 +252,4 @@
|
||||
return .
|
||||
if("toggleadvcontrol" in href_list)
|
||||
advcontrol = !advcontrol
|
||||
return MT_UPDATE
|
||||
|
||||
return MT_UPDATE
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
name = "passive gate"
|
||||
desc = "A one-way air valve that does not require power"
|
||||
|
||||
|
||||
can_unwrench = 1
|
||||
|
||||
var/on = 0
|
||||
@@ -15,7 +15,7 @@
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
@@ -34,8 +34,7 @@
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/process()
|
||||
..()
|
||||
if(!on)
|
||||
if(!..() || !on)
|
||||
return 0
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
@@ -60,6 +59,7 @@
|
||||
parent1.update = 1
|
||||
|
||||
parent2.update = 1
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/set_frequency(new_frequency)
|
||||
@@ -100,7 +100,7 @@
|
||||
/obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
|
||||
var/old_on = on //for logging
|
||||
|
||||
if("power" in signal.data)
|
||||
@@ -115,7 +115,7 @@
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
|
||||
if(on != old_on)
|
||||
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
|
||||
|
||||
@@ -161,4 +161,3 @@
|
||||
to_chat(user, "<span class='alert'>You cannot unwrench this [src], turn it off first.</span>")
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
@@ -15,10 +15,10 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/pump
|
||||
icon = 'icons/atmos/pump.dmi'
|
||||
icon_state = "map_off"
|
||||
|
||||
|
||||
name = "gas pump"
|
||||
desc = "A pump"
|
||||
|
||||
|
||||
can_unwrench = 1
|
||||
|
||||
var/on = 0
|
||||
@@ -54,10 +54,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/process()
|
||||
// ..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!on)
|
||||
if(!..() || (stat & (NOPOWER|BROKEN)) || !on)
|
||||
return 0
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
@@ -123,7 +120,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
|
||||
var/old_on = on //for logging
|
||||
|
||||
if(signal.data["power"])
|
||||
@@ -138,7 +135,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
|
||||
if(on != old_on)
|
||||
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
|
||||
|
||||
@@ -164,7 +161,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Topic(href,href_list)
|
||||
if(..())
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
|
||||
@@ -18,7 +18,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
name = "volumetric gas pump"
|
||||
desc = "A volumetric pump"
|
||||
|
||||
|
||||
can_unwrench = 1
|
||||
|
||||
var/on = 0
|
||||
@@ -31,7 +31,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/volume_pump/on
|
||||
on = 1
|
||||
icon_state = "map_on"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
@@ -52,9 +52,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
add_underlay(T, node2, dir)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!on)
|
||||
if(!..() || (stat & (NOPOWER|BROKEN)) || !on)
|
||||
return 0
|
||||
|
||||
// Pump mechanism just won't do anything if the pressure is too high/too low
|
||||
@@ -114,7 +112,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/volume_pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
|
||||
var/old_on = on //for logging
|
||||
|
||||
if(signal.data["power"])
|
||||
@@ -129,7 +127,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
text2num(signal.data["set_transfer_rate"]),
|
||||
air1.volume
|
||||
)
|
||||
|
||||
|
||||
if(on != old_on)
|
||||
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
|
||||
|
||||
@@ -154,7 +152,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Topic(href,href_list)
|
||||
if(..())
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["power"])
|
||||
on = !on
|
||||
|
||||
Reference in New Issue
Block a user