diff --git a/addons/breathing/functions/fnc_fullHealLocal.sqf b/addons/breathing/functions/fnc_fullHealLocal.sqf index 9791dd752..da3334e7a 100644 --- a/addons/breathing/functions/fnc_fullHealLocal.sqf +++ b/addons/breathing/functions/fnc_fullHealLocal.sqf @@ -18,7 +18,7 @@ params ["_patient"]; TRACE_1("fullHealLocal",_patient); -_patient setVariable [QGVAR(airwayStatus), 100, true]; +_patient setVariable [QGVAR(airwayStatus), 97, true]; _patient setVariable [QGVAR(pneumothorax), 0, true]; _patient setVariable [QGVAR(hemopneumothorax), false, true]; _patient setVariable [QGVAR(tensionpneumothorax), false, true]; diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index f30ea8623..d79c00950 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -320,12 +320,14 @@ #define GET_BODY_FLUID(unit) (unit getVariable [VAR_BODY_FLUID, DEFAULT_BODY_FLUID]) #define GET_BLOOD_VOLUME_LITERS(unit) ((GET_BODY_FLUID(unit) select 4) / 1000) +#define GET_BLOOD_VOLUME(unit) GET_BLOOD_VOLUME_LITERS(unit) #define GET_BLOOD_VOLUME_ML(unit) (GET_BODY_FLUID(unit) select 4) #define GET_SIMPLE_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME]) #define REDUCE_TOTAL_BLOOD_VOLUME(unit,volume) (unit setVariable [VAR_BODY_FLUID, [(GET_BODY_FLUID(unit) select 0) - (volume / 2), (GET_BODY_FLUID(unit) select 1) - (volume / 2), (GET_BODY_FLUID(unit) select 2), (GET_BODY_FLUID(unit) select 3), (GET_BODY_FLUID(unit) select 4) - volume], true]) #undef GET_BLOOD_PRESSURE + #define GET_BLOOD_PRESSURE(unit) ([unit] call EFUNC(circulation,getBloodPressure)) #define VAR_BLOODPRESSURE_CHANGE QEGVAR(circulation,bloodPressureChange) #define GET_BLOODPRESSURE_CHANGE(unit) (unit getVariable [VAR_BLOODPRESSURE_CHANGE, [0,0]]) diff --git a/addons/vitals/functions/fnc_handleOxygenFunction.sqf b/addons/vitals/functions/fnc_handleOxygenFunction.sqf index 05ce2a563..2171e2bba 100644 --- a/addons/vitals/functions/fnc_handleOxygenFunction.sqf +++ b/addons/vitals/functions/fnc_handleOxygenFunction.sqf @@ -121,7 +121,14 @@ _pao2 = if (_previousCyclePao2 != _pao2) then { ([ (_previousCyclePao2 - ((PAO2_ // Oxy-Hemo Dissociation Curve, driven by PaO2 with shaping done by pH private _o2Sat = ((_pao2 max 1)^2.7 / ((25 - (((_pH / DEFAULT_PH) - 1) * 150))^2.7 + _pao2^2.7)) min 0.999; +// If another mod is changing airwayStatus, default to airwayStatus value +private _externalAirway = _unit getVariable [QEGVAR(breathing,airwayStatus), 97]; +if (_o2Sat != _externalAirway) then { + _o2Sat = _externalAirway; +}; + _unit setVariable [VAR_BREATHING_RATE, (_respiratoryRate max 0), _syncValues]; _unit setVariable [VAR_BLOOD_GAS, [_paco2, _pao2, _o2Sat, 24, _pH, _etco2], _syncValues]; +_unit setVariable [QEGVAR(breathing,airwayStatus), ((_o2Sat * 100) min 0.999), _syncValues]; _o2Sat * 100