mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
* Raises the quantize threshold from 1E-7 to 1E-4. This makes gas dissipate as expected, and should help with the amount of useless gas floating around the station at highpop Adds a garbage_collect() call to the portion of pipeline code where all gasmixes are in one place, this should clean things up properly. Changes BREATH_VOLUME from 2 to 1.99. This is imperative Documents a FUCKING HELLBUG in quantize/breathcode that can lead to breaths just not working sometimes. I'm not sure how to fix this totally, so I'll document it and pray. See <https://www.desmos.com/calculator/5icdlnktus> Adds a unit test to check for this sort of failure. Addendum for people tweaking this value in the future. Because o2 tank release values/human o2 requirements are very strictly set to the same pressure, small errors can cause breakage This comes from QUANTIZE being used in /datum/gas_mixture.remove(), forming a slight sawtooth pattern of the added/removed gas, centered on the actual pressure Changing BREATH_VOLUME can set us on the lower half of this sawtooth, making humans unable to breath at standard pressure. There's no good way I can come up with to hardcode a fix for this. So if you're going to change this variable graph the functions that describe how it is used/how it interacts with breath code, and pick something on the upper half of the sawtooth NOTE: I've made this change with a focus on o2 requirements. Changing this will effect other settings, but most all of them can be ignored, as none will notice. * Thank you moth man Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> * Docs the purpose of the breath unit test, and better explains partial pressure Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
/// Tests to make sure humans can breath in normal situations
|
|
/// Built to prevent regression on an issue surrounding QUANTIZE() and BREATH_VOLUME
|
|
/// See the comment on BREATH_VOLUME for more details
|
|
/datum/unit_test/breath_sanity
|
|
|
|
/datum/unit_test/breath_sanity/Run()
|
|
var/mob/living/carbon/human/lab_rat = allocate(/mob/living/carbon/human)
|
|
var/obj/item/clothing/mask/breath/tube = allocate(/obj/item/clothing/mask/breath)
|
|
var/obj/item/tank/internals/emergency_oxygen/source = allocate(/obj/item/tank/internals/emergency_oxygen)
|
|
|
|
lab_rat.equip_to_slot_if_possible(tube, ITEM_SLOT_MASK)
|
|
lab_rat.equip_to_slot_if_possible(source, ITEM_SLOT_HANDS)
|
|
source.toggle_internals(lab_rat)
|
|
|
|
lab_rat.breathe()
|
|
|
|
TEST_ASSERT(!lab_rat.has_alert("not_enough_oxy"), "Humans can't get a full breath from standard o2 tanks")
|
|
lab_rat.clear_alert("not_enough_oxy")
|
|
|
|
//Prep the mob
|
|
lab_rat.forceMove(run_loc_floor_bottom_left)
|
|
source.toggle_internals(lab_rat)
|
|
TEST_ASSERT(!lab_rat.internal, "toggle_internals() failed to toggle internals")
|
|
|
|
var/turf/open/to_fill = run_loc_floor_bottom_left
|
|
//Prep the floor
|
|
to_fill.initial_gas_mix = OPENTURF_DEFAULT_ATMOS
|
|
to_fill.air = new
|
|
to_fill.air.copy_from_turf(to_fill)
|
|
|
|
lab_rat.breathe()
|
|
|
|
TEST_ASSERT(!lab_rat.has_alert("not_enough_oxy"), "Humans can't get a full breath from the standard initial_gas_mix on a turf")
|
|
|
|
|
|
|