mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
fixes runtimes
This commit is contained in:
@@ -24,12 +24,6 @@ Iconnery
|
||||
|
||||
..(intact)
|
||||
/*
|
||||
Helpers
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/update_airs(var/a1, var/a2)
|
||||
..(list("a1" = a1, "a2" = a2))
|
||||
/*
|
||||
Housekeeping and pipe network stuff
|
||||
*/
|
||||
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
//Actually transfer the gas
|
||||
var/datum/gas_mixture/removed = air2.remove(transfer_moles)
|
||||
|
||||
update_airs(air1, air2)
|
||||
|
||||
update_parents()
|
||||
|
||||
return removed
|
||||
|
||||
@@ -44,7 +44,6 @@ Acts like a normal vent, but has an input AND output.
|
||||
..()
|
||||
var/datum/gas_mixture/air1 = airs["a1"] ; air1.volume = 1000
|
||||
var/datum/gas_mixture/air2 = airs["a2"] ; air2.volume = 1000
|
||||
update_airs(air1, air2)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/update_icon_nopipes()
|
||||
overlays.Cut()
|
||||
@@ -88,7 +87,7 @@ Acts like a normal vent, but has an input AND output.
|
||||
loc.assume_air(removed)
|
||||
air_update_turf()
|
||||
|
||||
update_parents(list("p1" = parents["p1"])) //this looks disgusting, but it works
|
||||
var/datum/pipeline/parent1 = parents["p1"] ; parent1.update = 1
|
||||
|
||||
else //external -> output
|
||||
var/pressure_delta = 10000
|
||||
@@ -107,9 +106,7 @@ Acts like a normal vent, but has an input AND output.
|
||||
air2.merge(removed)
|
||||
air_update_turf()
|
||||
|
||||
update_parents(list("p2" = parents["p2"]))
|
||||
|
||||
update_airs(air1, air2)
|
||||
var/datum/pipeline/parent2 = parents["p2"] ; parent2.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ Passive gate is similar to the regular pump except:
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
air2.merge(removed)
|
||||
|
||||
update_airs(air1, air2)
|
||||
update_parents()
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/datum/gas_mixture/removed = air1.remove(transfer_moles)
|
||||
air2.merge(removed)
|
||||
|
||||
update_airs(air1, air2)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -29,7 +29,6 @@ It's like a regular ol' straight pipe, but you can turn it on and off.
|
||||
update_icon_nopipes()
|
||||
update_parents()
|
||||
var/datum/pipeline/parent1 = parents["p1"] ; parent1.reconcile_air()
|
||||
parents["p1"] = parent1
|
||||
investigate_log("was opened by [usr ? key_name(usr) : "a remote signal"]", "atmos")
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/proc/close()
|
||||
|
||||
@@ -65,7 +65,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
air2.merge(removed)
|
||||
|
||||
update_airs(air1, air2)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -20,7 +20,7 @@ On top of that, now people can add component-speciic procs/vars if they want!
|
||||
//BINARY = 2
|
||||
//TRINARY = 3
|
||||
|
||||
/obj/machinery/atmospherics/components/New() //it's workiiiing
|
||||
/obj/machinery/atmospherics/components/New()
|
||||
..()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
var/datum/gas_mixture/A = new
|
||||
@@ -55,8 +55,9 @@ Iconnery
|
||||
var/connected = 0
|
||||
|
||||
for(var/I = 1; I <= device_type; I++) //adds intact pieces
|
||||
var/obj/machinery/atmospherics/N = nodes["n[I]"]
|
||||
connected = icon_addintact(N, connected)
|
||||
if(nodes["n[I]"])
|
||||
connected = icon_addintact(nodes["n[I]"], connected)
|
||||
|
||||
icon_addbroken(connected) //adds broken pieces
|
||||
|
||||
|
||||
@@ -103,11 +104,11 @@ Pipenet stuff; housekeeping
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/nullifyPipenet(datum/pipeline/reference) //untestable
|
||||
/obj/machinery/atmospherics/components/nullifyPipenet(datum/pipeline/reference)
|
||||
..()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
var/datum/pipeline/P = parents["p[I]"]
|
||||
if(reference == P)
|
||||
if(reference == parents["p[I]"])
|
||||
var/datum/pipeline/P = parents["p[I]"]
|
||||
P.other_airs -= airs["a[I]"]
|
||||
P = null
|
||||
break
|
||||
@@ -117,14 +118,13 @@ Pipenet stuff; housekeeping
|
||||
if(reference == parents["p[I]"])
|
||||
return airs["a[I]"]
|
||||
|
||||
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference)
|
||||
if(!reference)
|
||||
return nodes
|
||||
var/I = 1
|
||||
for(var/obj/machinery/atmospherics/N in nodes)
|
||||
if(parents["p[I]"] == reference)
|
||||
return list(N)
|
||||
I++
|
||||
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference) //runtime
|
||||
if(reference)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(nodes["n[I]"])
|
||||
if(parents["p[I]"] == reference)
|
||||
return list("n" = nodes["n1"])
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
@@ -135,7 +135,7 @@ Pipenet stuff; housekeeping
|
||||
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(A == nodes["n[I]"])
|
||||
return parents["p[I]"] //probably works
|
||||
return parents["p[I]"]
|
||||
|
||||
/obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
|
||||
for(var/datum/pipeline/P in parents)
|
||||
@@ -182,21 +182,7 @@ I think this is NanoUI?
|
||||
/*
|
||||
Helpers
|
||||
*/
|
||||
/obj/machinery/atmospherics/components/proc/update_airs(var/list/L)
|
||||
var/I = 1
|
||||
for(var/datum/gas_mixture/air in L)
|
||||
airs["a[I]"] = air
|
||||
I++
|
||||
|
||||
/obj/machinery/atmospherics/components/proc/update_parents(var/list/L = parents)
|
||||
var/I = 1
|
||||
for(var/datum/pipeline/parent in L)
|
||||
parent.update = 1
|
||||
parents["p[I]"] = parent
|
||||
I++
|
||||
/obj/machinery/atmospherics/components/proc/init_airs()
|
||||
return
|
||||
/obj/machinery/atmospherics/components/proc/init_nodes()
|
||||
return
|
||||
/obj/machinery/atmospherics/components/proc/init_parents()
|
||||
return
|
||||
/obj/machinery/atmospherics/components/proc/update_parents()
|
||||
for(var/datum/pipeline/parent in parents)
|
||||
parent.update = 1
|
||||
@@ -146,7 +146,6 @@ Filter types:
|
||||
air2.merge(filtered_out)
|
||||
air3.merge(removed)
|
||||
|
||||
update_airs(air1, air2, air3)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -104,13 +104,12 @@
|
||||
air3.merge(removed2)
|
||||
|
||||
if(transfer_moles1)
|
||||
update_parents(list("p1" = parents["p1"]))
|
||||
var/datum/pipeline/parent1 = parents["p1"] ; parent1.update = 1
|
||||
|
||||
if(transfer_moles2)
|
||||
update_parents(list("p2" = parents["p2"]))
|
||||
var/datum/pipeline/parent2 = parents["p2"] ; parent2.update = 1
|
||||
|
||||
update_airs(air1, air2, air3)
|
||||
update_parents(list("p3" = parents["p3"]))
|
||||
var/datum/pipeline/parent3 = parents["p3"] ; parent3.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -19,11 +19,6 @@
|
||||
initialize_directions = WEST|NORTH|EAST
|
||||
|
||||
/*
|
||||
Helpers
|
||||
*/
|
||||
/obj/machinery/atmospherics/components/trinary/update_airs(var/a1, var/a2, var/a3)
|
||||
..(list("a1" = a1, "a2" = a2, "a3" = a3))
|
||||
/*
|
||||
Housekeeping and pipe network stuff
|
||||
*/
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
|
||||
//todo: have current temperature affected. require power to bring down current temperature again
|
||||
update_airs(air_contents)
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
update_parents()
|
||||
return 1
|
||||
|
||||
@@ -331,8 +331,6 @@
|
||||
if(combined_heat_capacity > 0)
|
||||
var/combined_energy = T20C * current_heat_capacity + air_heat_capacity * air_contents.temperature
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
update_airs(air_contents)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/expel_gas()
|
||||
var/datum/gas_mixture/air_contents = airs["a1"]
|
||||
@@ -344,5 +342,4 @@
|
||||
expel_gas = air_contents.remove(remove_amount)
|
||||
expel_gas.temperature = T20C //Lets expel hot gas and see if that helps people not die as they are removed
|
||||
loc.assume_air(expel_gas)
|
||||
air_update_turf()
|
||||
update_airs(air_contents)
|
||||
air_update_turf()
|
||||
@@ -66,7 +66,4 @@
|
||||
if(abs(other_old_temperature-partner_air_contents.temperature) > 1)
|
||||
partner.update_parents()
|
||||
|
||||
update_airs(air_contents)
|
||||
partner.update_airs(partner_air_contents)
|
||||
|
||||
return 1
|
||||
|
||||
@@ -43,5 +43,4 @@
|
||||
|
||||
if(abs(old_temperature-air_contents.temperature) > 1)
|
||||
update_parents()
|
||||
update_airs(air_contents)
|
||||
return 1
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
loc.assume_air(removed)
|
||||
air_update_turf()
|
||||
|
||||
update_airs(air_contents)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
@@ -75,7 +74,6 @@
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
update_airs(air_contents)
|
||||
update_parents()
|
||||
|
||||
flick("inje_inject", src)
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen)
|
||||
air_contents.oxygen += added_oxygen
|
||||
|
||||
update_airs(air_contents)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.carbon_dioxide = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
update_airs(air_contents)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/toxins
|
||||
icon_state = "orange"
|
||||
@@ -27,7 +26,6 @@
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.toxins = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
update_airs(air_contents)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b
|
||||
icon_state = "orange_2"
|
||||
@@ -41,7 +39,6 @@
|
||||
var/datum/gas/oxygen_agent_b/trace_gas = new
|
||||
trace_gas.moles = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
air_contents.trace_gases += trace_gas
|
||||
update_airs(air_contents)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen
|
||||
icon_state = "blue"
|
||||
@@ -53,7 +50,6 @@
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.oxygen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
update_airs(air_contents)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/nitrogen
|
||||
icon_state = "red"
|
||||
@@ -65,7 +61,6 @@
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.nitrogen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
update_airs(air_contents)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/air
|
||||
icon_state = "grey"
|
||||
@@ -77,5 +72,4 @@
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
air_contents.nitrogen = (25*ONE_ATMOSPHERE*N2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
update_airs(air_contents)
|
||||
air_contents.nitrogen = (25*ONE_ATMOSPHERE*N2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
@@ -9,12 +9,6 @@
|
||||
initialize_directions = dir
|
||||
|
||||
/*
|
||||
Helpers
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/update_airs(var/a1)
|
||||
..(list("a1" = a1))
|
||||
/*
|
||||
Iconnery
|
||||
*/
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs["a1"]
|
||||
air_contents.volume = 1000
|
||||
update_airs(air_contents)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/update_icon_nopipes()
|
||||
overlays.Cut()
|
||||
@@ -138,7 +137,6 @@
|
||||
|
||||
air_contents.merge(removed)
|
||||
air_update_turf()
|
||||
update_airs(air_contents)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
|
||||
@@ -169,7 +169,6 @@
|
||||
air_contents.merge(removed)
|
||||
air_update_turf()
|
||||
|
||||
update_airs(air_contents)
|
||||
update_parents()
|
||||
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user