From fc7e21ffdb5c26bf8b71eae7b5a5af683cf5e20b Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Sat, 29 Sep 2018 01:23:07 +0300 Subject: [PATCH] dunc hurting juice --- .../atmospherics/gasmixtures/gas_mixture.dm | 10 +++------- .../gasmixtures/immutable_mixtures.dm | 4 +--- .../atmospherics/machinery/datum_pipeline.dm | 17 ++++++++++------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index b0b757f5d31..c1d9874a646 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -29,6 +29,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) var/last_share = 0 var/list/reaction_results var/list/analyzer_results //used for analyzer feedback - not initialized until its used + var/gc_share = FALSE // Whether to call garbage_collect() on the sharer during shares, used for immutable mixtures /datum/gas_mixture/New(volume) gases = new @@ -154,9 +155,6 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) //Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length //Returns: amount of gas exchanged (+ if sharer received) -/datum/gas_mixture/proc/after_share(datum/gas_mixture/sharer) - //called on share's sharer to let it know it just got some gases - /datum/gas_mixture/proc/temperature_share(datum/gas_mixture/sharer, conduction_coefficient) //Performs temperature sharing calculations (via conduction) between two gas_mixtures assuming only 1 boundary length //Returns: new temperature of the sharer @@ -354,7 +352,8 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) if(length(cached_gases ^ sharer_gases)) //if all gases were present in both mixtures, we know that no gases are 0 garbage_collect(cached_gases - sharer_gases) //any gases the sharer had, we are guaranteed to have. gases that it didn't have we are not. sharer.garbage_collect(sharer_gases - cached_gases) //the reverse is equally true - sharer.after_share(src, atmos_adjacent_turfs) + if (initial(sharer.gc_share)) + sharer.garbage_collect() if(temperature_delta > MINIMUM_TEMPERATURE_TO_MOVE || abs(moved_moles) > MINIMUM_MOLES_DELTA_TO_MOVE) var/our_moles TOTAL_MOLES(cached_gases,our_moles) @@ -362,9 +361,6 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) TOTAL_MOLES(sharer_gases,their_moles) return (temperature_archived*(our_moles + moved_moles) - sharer.temperature_archived*(their_moles - moved_moles)) * R_IDEAL_GAS_EQUATION / volume -/datum/gas_mixture/after_share(datum/gas_mixture/sharer, atmos_adjacent_turfs = 4) - return - /datum/gas_mixture/temperature_share(datum/gas_mixture/sharer, conduction_coefficient, sharer_temperature, sharer_heat_capacity) //transfer of thermal energy (via conduction) between self and sharer if(sharer) diff --git a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm index 90b95500283..c3004fb6fad 100644 --- a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm +++ b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm @@ -3,6 +3,7 @@ /datum/gas_mixture/immutable var/initial_temperature + gc_share = TRUE /datum/gas_mixture/immutable/New() ..() @@ -23,9 +24,6 @@ . = ..(sharer, 0) garbage_collect() -/datum/gas_mixture/immutable/after_share() - garbage_collect() - /datum/gas_mixture/immutable/react() return 0 //we're immutable. diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index cfaef38f6c9..c4fa387ab02 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -221,13 +221,16 @@ if(!P) continue GL += P.return_air() - for(var/obj/machinery/atmospherics/components/binary/valve/V in P.other_atmosmch) - if(V.on) - PL |= V.parents[1] - PL |= V.parents[2] - for(var/obj/machinery/atmospherics/components/unary/portables_connector/C in P.other_atmosmch) - if(C.connected_device) - GL += C.portableConnectorReturnAir() + for(var/atmosmch in P.other_atmosmch) + if (istype(atmosmch, /obj/machinery/atmospherics/components/binary/valve)) + var/obj/machinery/atmospherics/components/binary/valve/V = atmosmch + if(V.on) + PL |= V.parents[1] + PL |= V.parents[2] + else if (istype(atmosmch, /obj/machinery/atmospherics/components/unary/portables_connector)) + var/obj/machinery/atmospherics/components/unary/portables_connector/C = atmosmch + if(C.connected_device) + GL += C.portableConnectorReturnAir() var/total_thermal_energy = 0 var/total_heat_capacity = 0