Merge pull request #3210 from Citadel-Station-13/upstream-merge-31388

[MIRROR] Moves assert_gas() into a define it should always have been, speeding up atmos slightly
This commit is contained in:
LetterJay
2017-10-08 16:19:12 -04:00
committed by GitHub
17 changed files with 263 additions and 274 deletions
+9 -1
View File
@@ -175,4 +175,12 @@
#define LAVALAND_EQUIPMENT_EFFECT_PRESSURE 50 //what pressure you have to be under to increase the effect of equipment meant for lavaland
#define LAVALAND_DEFAULT_ATMOS "o2=14;n2=23;TEMP=300"
#define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity())
#define THERMAL_ENERGY(gas) (gas.temperature * gas.heat_capacity())
#define ADD_GAS(gas_id, out_list)\
var/list/tmp_gaslist = GLOB.gaslist_cache[gas_id];\
out_list[gas_id] = tmp_gaslist.Copy();
//ASSERT_GAS(gas_id, gas_mixture) - used to guarantee that the gas list for this id exists in gas_mixture.gases.
//Must be used before adding to a gas. May be used before reading from a gas.
#define ASSERT_GAS(gas_id, gas_mixture) if (!gas_mixture.gases[gas_id]) { ADD_GAS(gas_id, gas_mixture.gases) };