extreme optimization project to maybe fix game
This commit is contained in:
@@ -131,11 +131,10 @@
|
||||
var/pressure_delta = target_pressure - target_air.return_pressure()
|
||||
if(pressure_delta > 0.1)
|
||||
var/transfer_moles = (pressure_delta*target_air.return_volume()/(source_air.return_temperature() * R_IDEAL_GAS_EQUATION))*PUMP_EFFICIENCY
|
||||
var/datum/gas_mixture/removed = source_air.remove(transfer_moles)
|
||||
if(istype(snowflake)) //Snowflake check for tanks specifically, because tank ruptures are handled in a very snowflakey way that expects all tank interactions to be handled via the tank's procs
|
||||
snowflake.assume_air(removed)
|
||||
snowflake.assume_air_moles(source_air, transfer_moles)
|
||||
else
|
||||
target_air.merge(removed)
|
||||
source_air.transfer_to(target_air, transfer_moles)
|
||||
|
||||
|
||||
// - volume pump - // **Works**
|
||||
@@ -183,12 +182,10 @@
|
||||
//The second part of the min caps the pressure built by the volume pumps to the max pump pressure
|
||||
var/transfer_ratio = min(transfer_rate,target_air.return_volume()*PUMP_MAX_PRESSURE/source_air.return_pressure())/source_air.return_volume()
|
||||
|
||||
var/datum/gas_mixture/removed = source_air.remove_ratio(transfer_ratio * PUMP_EFFICIENCY)
|
||||
|
||||
if(istype(snowflake))
|
||||
snowflake.assume_air(removed)
|
||||
snowflake.assume_air_ratio(source_air, transfer_ratio * PUMP_EFFICIENCY)
|
||||
else
|
||||
target_air.merge(removed)
|
||||
source_air.transfer_ratio_to(target_air, transfer_ratio * PUMP_EFFICIENCY)
|
||||
|
||||
|
||||
// - gas vent - // **works**
|
||||
@@ -468,16 +465,12 @@
|
||||
|
||||
var/snowflakecheck = istype(gas_output, /obj/item/tank)
|
||||
|
||||
var/datum/gas_mixture/mix = source_1_gases.remove(transfer_moles * gas_percentage)
|
||||
if(snowflakecheck)
|
||||
gas_output.assume_air(mix)
|
||||
gas_output.assume_air_moles(source_1_gases, transfer_moles * gas_percentage)
|
||||
gas_output.assume_air_moles(source_2_gases, transfer_moles * (1-gas_percentage))
|
||||
else
|
||||
output_gases.merge(mix)
|
||||
mix = source_2_gases.remove(transfer_moles * (1-gas_percentage))
|
||||
if(snowflakecheck)
|
||||
gas_output.assume_air(mix)
|
||||
else
|
||||
output_gases.merge(mix)
|
||||
source_1_gases.transfer_to(output_gases, transfer_moles * gas_percentage)
|
||||
source_2_gases.transfer_to(output_gases, transfer_moles * (1-gas_percentage))
|
||||
|
||||
|
||||
// - integrated tank - // **works**
|
||||
|
||||
@@ -292,10 +292,7 @@
|
||||
if(!source_air || !target_air)
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/removed = source_air.remove(gas_per_throw)
|
||||
if(!removed)
|
||||
return
|
||||
target_air.merge(removed)
|
||||
source_air.transfer_to(target_air, gas_per_throw)
|
||||
|
||||
// If the item is in a grabber circuit we'll update the grabber's outputs after we've thrown it.
|
||||
var/obj/item/integrated_circuit/manipulation/grabber/G = A.loc
|
||||
|
||||
Reference in New Issue
Block a user