diff --git a/addons/scuba/XEH_preInit.sqf b/addons/scuba/XEH_preInit.sqf index bab4a254dc..ee40ddf12c 100644 --- a/addons/scuba/XEH_preInit.sqf +++ b/addons/scuba/XEH_preInit.sqf @@ -4,16 +4,14 @@ ADDON = false; #include "XEH_PREP.hpp" -GVAR(inertGasTypes) = ["nitrogen", "helium"]; -GVAR(inertGasHalftimes) = [ - [4, 8, 12.5, 18.5, 27, 38.3, 54.3, 77, 109, 146, 187, 239, 305, 390, 498, 635], - [1.5, 3.0, 4.7, 7.0, 10.2, 14.5, 20.5, 29.1, 41.1, 55.1, 70.6, 90.2, 115.1, 147.2, 187.9, 239.6] +GVAR(halftimes) = [ + 4, 8, 12.5, 18.5, 27, 38.3, 54.3, 77, 109, 146, 187, 239, 305, 390, 498, 635 ]; -GVAR(interGasAValues) = GVAR(inertGasHalftimes) apply {_x apply { +GVAR(aValues) = GVAR(nitrogenHalftimes) apply { 2 * _x ^ (-1/3) -}}; -GVAR(interGasBValues) = GVAR(inertGasHalftimes) apply {_x apply { +}; +GVAR(bValues) = GVAR(nitrogenHalftimes) apply { 1.005 - (_x ^ (-1/2)) -}}; +}; ADDON = true; diff --git a/addons/scuba/functions/fnc_calculateSafePressure.sqf b/addons/scuba/functions/fnc_calculateSafePressure.sqf index 69b720d5b4..aef66c0692 100644 --- a/addons/scuba/functions/fnc_calculateSafePressure.sqf +++ b/addons/scuba/functions/fnc_calculateSafePressure.sqf @@ -13,8 +13,8 @@ private _maxPAmbtol = 0; { - private _a = GVAR(interGasAValues) select (_forEachIndex * 2); - private _b = GVAR(interGasBValues) select (_forEachIndex * 2); + private _a = GVAR(aValues) select (_forEachIndex * 2); + private _b = GVAR(aValues) select (_forEachIndex * 2); private _pAmbtol = (_x - _a) * _b; _maxPAmbtol = _maxPAmbTol max _pAmbtol; diff --git a/addons/scuba/functions/fnc_updateCompartments.sqf b/addons/scuba/functions/fnc_updateCompartments.sqf index 8ce7b7eef3..35db0807ee 100644 --- a/addons/scuba/functions/fnc_updateCompartments.sqf +++ b/addons/scuba/functions/fnc_updateCompartments.sqf @@ -10,14 +10,13 @@ */ #include "script_component.hpp" -private _compartments = ACE_player getVariable [QGVAR(compartments), [0,0,0,0,0,0,0,0]]; +private _compartments = ACE_player getVariable [QGVAR(compartments), [0.745,0.745,0.745,0.745,0.745,0.745,0.745,0.745]]; { private _pBegin = _x; - private _pGas = ACE_player getVariable QGVAR(inertGasPressure); + private _pGas = ACE_player getVariable QGVAR(nitrogenPressure); private _tExposure = 1/60; - private _gasType = ACE_player getVariable QGVAR(inertGasType); - private _tHalftime = (GVAR(inertGasHalftimes) select (GVAR(inertGasTypes) find _gasType)) select (_forEachIndex * 2); + private _tHalftime = GVAR(halftimes) select (_forEachIndex * 2); // Bühlmann algorithm private _pComp = _pBegin + (_pGas - _pBegin) * (1 - 2 ^ (-1 * _tExposure / _tHalftime));