Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breathing/Vitals - Add Compatibility #723

Open
wants to merge 3 commits into
base: dev-Tomcat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 2 additions & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]])
Expand Down
7 changes: 7 additions & 0 deletions addons/vitals/functions/fnc_handleOxygenFunction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading