removes silly garbage defines
This commit is contained in:
committed by
CitadelStationBot
parent
d5708c981a
commit
0f2fd05e87
@@ -15,10 +15,10 @@ On top of that, now people can add component-speciic procs/vars if they want!
|
||||
airs = new(device_type)
|
||||
..()
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/i in 1 to device_type)
|
||||
var/datum/gas_mixture/A = new
|
||||
A.volume = 200
|
||||
AIR_I = A
|
||||
airs[i] = A
|
||||
/*
|
||||
Iconnery
|
||||
*/
|
||||
@@ -42,9 +42,9 @@ Iconnery
|
||||
|
||||
var/connected = 0 //Direction bitset
|
||||
|
||||
for(DEVICE_TYPE_LOOP) //adds intact pieces
|
||||
if(NODE_I)
|
||||
connected |= icon_addintact(NODE_I)
|
||||
for(var/i in 1 to device_type) //adds intact pieces
|
||||
if(nodes[i])
|
||||
connected |= icon_addintact(nodes[i])
|
||||
|
||||
icon_addbroken(connected) //adds broken pieces
|
||||
|
||||
@@ -53,52 +53,45 @@ Iconnery
|
||||
Pipenet stuff; housekeeping
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/nullifyNode(I)
|
||||
/obj/machinery/atmospherics/components/nullifyNode(i)
|
||||
..()
|
||||
if(NODE_I)
|
||||
nullifyPipenet(PARENT_I)
|
||||
qdel(AIR_I)
|
||||
AIR_I = null
|
||||
if(nodes[i])
|
||||
nullifyPipenet(parents[i])
|
||||
QDEL_NULL(airs[i])
|
||||
|
||||
/obj/machinery/atmospherics/components/on_construction()
|
||||
..()
|
||||
update_parents()
|
||||
|
||||
/obj/machinery/atmospherics/components/build_network()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(!PARENT_I)
|
||||
PARENT_I = new /datum/pipeline()
|
||||
var/datum/pipeline/P = PARENT_I
|
||||
for(var/i in 1 to device_type)
|
||||
if(!parents[i])
|
||||
parents[i] = new /datum/pipeline()
|
||||
var/datum/pipeline/P = parents[i]
|
||||
P.build_pipeline(src)
|
||||
|
||||
/obj/machinery/atmospherics/components/proc/nullifyPipenet(datum/pipeline/reference)
|
||||
var/I = parents.Find(reference)
|
||||
reference.other_airs -= AIR_I
|
||||
var/i = parents.Find(reference)
|
||||
reference.other_airs -= airs[i]
|
||||
reference.other_atmosmch -= src
|
||||
PARENT_I = null
|
||||
parents[i] = null
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenetAir(datum/pipeline/reference)
|
||||
var/I = parents.Find(reference)
|
||||
return AIR_I
|
||||
return airs[parents.Find(reference)]
|
||||
|
||||
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference)
|
||||
if(reference)
|
||||
var/I = parents.Find(reference)
|
||||
return list(NODE_I)
|
||||
else
|
||||
return ..()
|
||||
return list(nodes[parents.Find(reference)])
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A)
|
||||
var/I = nodes.Find(A)
|
||||
PARENT_I = reference
|
||||
parents[nodes.Find(A)] = reference
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = NODE1) //returns PARENT1 if called without argument
|
||||
var/I = nodes.Find(A)
|
||||
return PARENT_I
|
||||
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = nodes[1]) //returns parents[1] if called without argument
|
||||
return parents[nodes.Find(A)]
|
||||
|
||||
/obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
|
||||
var/I = parents.Find(Old)
|
||||
PARENT_I = New
|
||||
parents[parents.Find(Old)] = New
|
||||
|
||||
/obj/machinery/atmospherics/components/unsafe_pressure_release(var/mob/user, var/pressures)
|
||||
..()
|
||||
@@ -109,15 +102,15 @@ Pipenet stuff; housekeeping
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/lost = null
|
||||
var/times_lost = 0
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/gas_mixture/air = AIR_I
|
||||
for(var/i in 1 to device_type)
|
||||
var/datum/gas_mixture/air = airs[i]
|
||||
lost += pressures*environment.volume/(air.temperature * R_IDEAL_GAS_EQUATION)
|
||||
times_lost++
|
||||
var/shared_loss = lost/times_lost
|
||||
|
||||
var/datum/gas_mixture/to_release
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/gas_mixture/air = AIR_I
|
||||
for(var/i in 1 to device_type)
|
||||
var/datum/gas_mixture/air = airs[i]
|
||||
if(!to_release)
|
||||
to_release = air.remove(shared_loss)
|
||||
continue
|
||||
@@ -136,8 +129,8 @@ Helpers
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/proc/update_parents()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/pipeline/parent = PARENT_I
|
||||
for(var/i in 1 to device_type)
|
||||
var/datum/pipeline/parent = parents[i]
|
||||
if(!parent)
|
||||
throw EXCEPTION("Component is missing a pipenet! Rebuilding...")
|
||||
build_network()
|
||||
@@ -145,8 +138,8 @@ Helpers
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenets()
|
||||
. = list()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
. += returnPipenet(NODE_I)
|
||||
for(var/i in 1 to device_type)
|
||||
. += returnPipenet(nodes[i])
|
||||
|
||||
/*
|
||||
UI Stuff
|
||||
@@ -157,4 +150,3 @@ UI Stuff
|
||||
return ..()
|
||||
to_chat(user, "<span class='danger'>Access denied.</span>")
|
||||
return UI_CLOSE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user