Merge pull request #6142 from Citadel-Station-13/upstream-merge-36667
[MIRROR] Gas react is much more efficient
This commit is contained in:
@@ -8,6 +8,7 @@ What are the archived variables for?
|
||||
once gases got hot enough, most procedures wouldnt occur due to the fact that the mole counts would get rounded away. Thus, we lowered it a few orders of magnititude */
|
||||
GLOBAL_LIST_INIT(meta_gas_info, meta_gas_list()) //see ATMOSPHERICS/gas_types.dm
|
||||
GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
|
||||
GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide))) // These gasses cannot react amongst themselves
|
||||
|
||||
/proc/init_gaslist_cache()
|
||||
. = list()
|
||||
@@ -411,10 +412,18 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
|
||||
|
||||
/datum/gas_mixture/react(turf/open/dump_location)
|
||||
. = NO_REACTION
|
||||
|
||||
reaction_results = new
|
||||
|
||||
var/list/cached_gases = gases
|
||||
if(!cached_gases.len)
|
||||
return
|
||||
var/possible
|
||||
for(var/I in cached_gases)
|
||||
if(GLOB.nonreactive_gases[I])
|
||||
continue
|
||||
possible = TRUE
|
||||
break
|
||||
if(!possible)
|
||||
return
|
||||
reaction_results = new
|
||||
var/temp = temperature
|
||||
var/ener = THERMAL_ENERGY(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user