mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
[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:
@@ -92,6 +92,10 @@
|
||||
|
||||
var/datum/gas_mixture/env = L.return_air() //get air from the turf
|
||||
var/datum/gas_mixture/removed = env.remove(0.1 * env.total_moles())
|
||||
|
||||
if(!removed)
|
||||
return
|
||||
|
||||
removed.assert_gases(/datum/gas/water_vapor, /datum/gas/oxygen, /datum/gas/hydrogen)
|
||||
var/proportion = min(removed.gases[/datum/gas/water_vapor][MOLES], (1.5 * delta_time * workingPower))//Works to max 12 moles at a time.
|
||||
removed.gases[/datum/gas/water_vapor][MOLES] -= proportion * 2 * workingPower
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user