mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 18:45:22 +01:00
Refactor gasmix mole change into a proc (#95327)
## About The Pull Request Refactor the majority of the current gasmix mole change use cases into a proc called adjust_gas which simply adds the designated mole count of the species into the gas mix while also handling asserting the gas and garbage_collect() I also added adjust_multiple_gases and convert_gas() for modifying multiple gases and within a gasmix ## Why It's Good For The Game Lemon wanted this to be done as part of the air group refactor ## Changelog 🆑 refactor: refactored majority of gas_mix mole change into adjust_gas() proc /🆑
This commit is contained in:
@@ -68,11 +68,11 @@
|
||||
var/turf/open/our_turf = src.loc
|
||||
if(!our_turf.air || !our_turf.air.gases[/datum/gas/carbon_dioxide])
|
||||
return
|
||||
|
||||
var/co2 = our_turf.air.gases[/datum/gas/carbon_dioxide][MOLES]
|
||||
var/datum/gas_mixture/our_air = our_turf.air
|
||||
var/co2 = our_air.gases[/datum/gas/carbon_dioxide][MOLES]
|
||||
if(co2 > 0 && SPT_PROB(13, seconds_per_tick))
|
||||
var/amt = min(co2, 9)
|
||||
our_turf.air.gases[/datum/gas/carbon_dioxide][MOLES] -= amt
|
||||
our_air.adjust_gas(/datum/gas/carbon_dioxide, -amt)
|
||||
our_turf.atmos_spawn_air("[GAS_O2]=[amt]")
|
||||
|
||||
/mob/living/basic/tree/melee_attack(atom/target, list/modifiers, ignore_cooldown = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user