mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Medical Treatment - Fix low SpO2 making units go into cardiac arrest again (#10003)
* Set SpO2 after successful CPR * Update fnc_cprLocal.sqf * Add API * Update fnc_cprLocal.sqf
This commit is contained in:
parent
62353a9175
commit
2a3ff8e185
@ -24,9 +24,14 @@ TRACE_2("cprLocal",_medic,_patient);
|
||||
private _bloodVolume = GET_BLOOD_VOLUME(_patient);
|
||||
private _successChance = linearConversion [BLOOD_VOLUME_CLASS_4_HEMORRHAGE, BLOOD_VOLUME_CLASS_2_HEMORRHAGE, _bloodVolume, GVAR(cprSuccessChanceMin), GVAR(cprSuccessChanceMax), true];
|
||||
if ((random 1) < _successChance) then {
|
||||
// If SpO2 is too low, it will make HR skyrocket to the point where patient goes back into CA
|
||||
// Allow 3rd party mods to disable this mechanic
|
||||
if (missionNamespace getVariable [QGVAR(setSpO2UponCPRSuccess), true] && {GET_SPO2(_patient) < DEFAULT_SPO2 / 2}) then {
|
||||
_patient setVariable [VAR_SPO2, DEFAULT_SPO2 / 2, true];
|
||||
};
|
||||
|
||||
TRACE_2("CPR random success",_bloodVolume,_successChance);
|
||||
[QEGVAR(medical,CPRSucceeded), _patient] call CBA_fnc_localEvent;
|
||||
} else {
|
||||
TRACE_2("CPR random fail",_bloodVolume,_successChance);
|
||||
};
|
||||
|
||||
|
@ -128,3 +128,10 @@ If a mission maker wishes to disable Zeus access to the medical menu, they can s
|
||||
```sqf
|
||||
ace_medical_gui_enableZeusModule = false; // default is true
|
||||
```
|
||||
|
||||
### 3.3 SpO2 Configuration
|
||||
|
||||
If 3rd party mods want to disable SpO2 being set to a minimum upon successful CPR, they can set the variable below:
|
||||
```sqf
|
||||
ace_medical_treatment_setSpO2UponCPRSuccess = false; // default is true
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user