From 824a80266792d2a5a206676444787df32eece2a2 Mon Sep 17 00:00:00 2001 From: SapphicOverload Date: Thu, 15 Dec 2022 17:39:40 -0500 Subject: [PATCH] i hate simplehorror i hate simplehorror i hate simplehorror --- code/modules/atmospherics/gasmixtures/gas_mixture.dm | 2 ++ code/modules/atmospherics/gasmixtures/reactions.dm | 3 +++ 2 files changed, 5 insertions(+) diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 96a72f312475..41c51dfc01b0 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -185,6 +185,8 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) reactions += SSair.gas_reactions[I] if(!length(reactions)) return + if (length(reactions) > 1) + reactions = sortTim(reactions, /proc/cmp_gas_reaction) reaction_results = new var/temp = return_temperature() var/ener = thermal_energy() diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index ce9706d909ac..6c2018df8541 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -58,6 +58,9 @@ nobliumformation = 1001 maxb = R.priority return maxb - maxa +/proc/cmp_gas_reaction(datum/gas_reaction/a, datum/gas_reaction/b) // compares the priority of two gas reactions + return b.priority - a.priority + /datum/gas_reaction //regarding the requirements lists: the minimum or maximum requirements must be non-zero. //when in doubt, use MINIMUM_MOLE_COUNT.