From cc493e08eec57a1311314af6b08d6d97db5d3f77 Mon Sep 17 00:00:00 2001 From: SECBATON GRIFFON <87321915+SECBATON-GRIFFON@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:56:58 +0100 Subject: [PATCH] Fixes possible molar ratio runtime (#36695) --- code/ZAS/_gas_mixture.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ZAS/_gas_mixture.dm b/code/ZAS/_gas_mixture.dm index 4bfae0621e0..2b55707eb91 100644 --- a/code/ZAS/_gas_mixture.dm +++ b/code/ZAS/_gas_mixture.dm @@ -132,7 +132,7 @@ return temperature * heat_capacity() /datum/gas_mixture/proc/molar_ratio(g) //ratio of moles of the input gas to total mols of all gasses in the area - return src[g] / total_moles + return total_moles && (src[g] / total_moles) //&& short circuits if total_moles is 0, and returns the second expression if it is not. /datum/gas_mixture/proc/molar_density(g) //Per liter. You should probably be using pressure instead, but considering this had to be made, you wouldn't be the first not to. return (g ? src[g] : total_moles) / volume