mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Fixes possible molar ratio runtime (#36695)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user