diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 376ca08b28..dd6e4ffe71 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -412,7 +412,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) return "" /datum/gas_mixture/react(turf/open/dump_location) - . = 0 + . = NO_REACTION reaction_results = new @@ -436,6 +436,22 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) continue reaction_loop //at this point, all minimum requirements for the reaction are satisfied. + /* currently no reactions have maximum requirements, so we can leave the checks commented out for a slight performance boost + PLEASE DO NOT REMOVE THIS CODE. the commenting is here only for a performance increase. + enabling these checks should be as easy as possible and the fact that they are disabled should be as clear as possible + + var/list/max_reqs = reaction.max_requirements.Copy() + if((max_reqs["TEMP"] && temp > max_reqs["TEMP"]) \ + || (max_reqs["ENER"] && ener > max_reqs["ENER"])) + continue + max_reqs -= "TEMP" + max_reqs -= "ENER" + for(var/id in max_reqs) + if(cached_gases[id] && cached_gases[id][MOLES] > max_reqs[id]) + continue reaction_loop + //at this point, all requirements for the reaction are satisfied. we can now react() + */ + . |= reaction.react(src, dump_location) if (. & STOP_REACTIONS) break