mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Improves how gas mixture datums are handled, reduces proc calls, commenting. Removed ghost-heating from cryo and "oxygen_agent_b" gas type.
This commit is contained in:
@@ -33,7 +33,7 @@ obj/machinery/atmospherics/unary/oxygen_generator
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/total_moles = air_contents.total_moles()
|
||||
var/total_moles = air_contents.total_moles
|
||||
|
||||
if(total_moles < oxygen_content)
|
||||
var/current_heat_capacity = air_contents.heat_capacity()
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
|
||||
//Get processable air sample and thermal info from environment
|
||||
|
||||
var/transfer_moles = 0.25 * environment.total_moles()
|
||||
var/transfer_moles = 0.25 * environment.total_moles
|
||||
var/datum/gas_mixture/external_removed = environment.remove(transfer_moles)
|
||||
|
||||
if (!external_removed)
|
||||
return radiate()
|
||||
|
||||
if (external_removed.total_moles() < 10)
|
||||
if (external_removed.total_moles < 10)
|
||||
return radiate()
|
||||
|
||||
//Get same info from connected gas
|
||||
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
|
||||
if (!internal_removed)
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
proc/radiate()
|
||||
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles()
|
||||
var/internal_transfer_moles = 0.25 * air_contents.total_moles
|
||||
var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles)
|
||||
|
||||
if (!internal_removed)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
if(scrubbing)
|
||||
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles
|
||||
|
||||
//Take a gas sample
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
@@ -117,15 +117,13 @@
|
||||
|
||||
if(removed.trace_gases.len>0)
|
||||
for(var/datum/gas/trace_gas in removed.trace_gases)
|
||||
if(istype(trace_gas, /datum/gas/oxygen_agent_b))
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
else if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
if(istype(trace_gas, /datum/gas/sleeping_agent) && scrub_N2O)
|
||||
removed.trace_gases -= trace_gas
|
||||
filtered_out.trace_gases += trace_gas
|
||||
|
||||
|
||||
//Remix the resulting gases
|
||||
filtered_out.update_values()
|
||||
air_contents.merge(filtered_out)
|
||||
|
||||
loc.assume_air(removed)
|
||||
@@ -137,7 +135,7 @@
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
var/transfer_moles = environment.total_moles*(volume_rate/environment.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user