[MIRROR] Fix two gas assertion runtimes (#816)

* Fix two gas assertion runtimes (#53718)

/datum/gas_mixture/proc/remove(amount) has a code path that can return null.

All the code following the runtimes assume some bit of gas_mixture was actually removed at all. No need to trigger this code if there's no gas_mixture removed, can early return instead.

* Fix two gas assertion runtimes

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
SkyratBot
2020-09-16 01:29:24 +01:00
committed by GitHub
co-authored by Timberpoes
parent b3072cdc31
commit e3bbcbb1d3
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -363,6 +363,10 @@ This section is for the destabilized SM
var/datum/gas_mixture/removed
var/gasefficency = 0.5
removed = env.remove(gasefficency * env.total_moles())
if(!removed)
return
removed.assert_gases(/datum/gas/bz, /datum/gas/miasma)
if(!removed || !removed.total_moles() || isspaceturf(loc_turf))
removed.gases[/datum/gas/bz][MOLES] += 0.5