Skip to content

Commit

Permalink
Fixes possible molar ratio runtime (#36695)
Browse files Browse the repository at this point in the history
  • Loading branch information
SECBATON-GRIFFON authored Jun 25, 2024
1 parent f51cf58 commit cc493e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/ZAS/_gas_mixture.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc493e0

Please sign in to comment.