diff --git a/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf b/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf index 90e8b14cd..562fac3e3 100644 --- a/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf @@ -179,13 +179,13 @@ if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false] && {((_pati if (GVAR(AdvRhythm)) then { private _cardiacState = _patient getVariable [QGVAR(cardiacArrestType), 0]; - if (_patient getVariable [QGVAR(cardiacArrestType), 0] in [2,4]) then { + if (_cardiacState in [2,4]) then { _hr = _patient call FUNC(getCardiacArrestHeartRate); } else { _hr = _patient getVariable [QACEGVAR(medical,heartRate), 80]; }; - if (!(_patient getVariable [QGVAR(cardiacArrestType), 0] in [0,2]) && !(GVAR(analyzeDelay))) then { + if (!(_cardiacState in [0,2]) && !(GVAR(analyzeDelay))) then { [{ params ["_patient"]; diff --git a/addons/circulation/functions/fnc_AED_Shock.sqf b/addons/circulation/functions/fnc_AED_Shock.sqf index dece395d3..114a89e99 100644 --- a/addons/circulation/functions/fnc_AED_Shock.sqf +++ b/addons/circulation/functions/fnc_AED_Shock.sqf @@ -37,7 +37,7 @@ _patient setVariable [QGVAR(RhythmAnalyzed), false, true]; params ["_patient"]; _patient setVariable [QGVAR(heartRestart), false, true]; -}, [_patient], 2] call CBA_fnc_waitAndExecute; +}, [_patient], 4] call CBA_fnc_waitAndExecute; [{ params ["_patient"]; @@ -48,7 +48,7 @@ _patient setVariable [QGVAR(RhythmAnalyzed), false, true]; _patient setVariable [QGVAR(Defibrillator_ShockAmount), (_patient getVariable [QGVAR(Defibrillator_ShockAmount), 0]) + 1, true]; if (alive _patient) then { - if (_patient getVariable [VAR_CRDC_ARRST, false]) then { + if (IN_CRDC_ARRST(_patient)) then { [QACEGVAR(medical_treatment,cprLocal), [_medic, _patient, _defibType], _patient] call CBA_fnc_targetEvent; } else { if (GVAR(AdvRhythm) && GVAR(AdvRhythm_Hardcore_Enable)) then { diff --git a/addons/circulation/functions/fnc_handleCardiacArrest.sqf b/addons/circulation/functions/fnc_handleCardiacArrest.sqf index 56e80bc9a..7a23362b4 100644 --- a/addons/circulation/functions/fnc_handleCardiacArrest.sqf +++ b/addons/circulation/functions/fnc_handleCardiacArrest.sqf @@ -32,6 +32,10 @@ private _cardiacArrestType = 0; if !(GVAR(AdvRhythm)) exitWith {}; if !(alive _unit) exitWith {_unit setVariable [QGVAR(cardiacArrestType), 1, true];}; +if ((_unit getVariable [QGVAR(cardiacArrestType), 0] != 0) && _initial) then { + _initial = false; +}; + if (_initial) then { if !(_active) exitWith {}; diff --git a/addons/zeus/functions/fnc_ui_changeCardiacState.sqf b/addons/zeus/functions/fnc_ui_changeCardiacState.sqf index dedee734c..d8c6338be 100644 --- a/addons/zeus/functions/fnc_ui_changeCardiacState.sqf +++ b/addons/zeus/functions/fnc_ui_changeCardiacState.sqf @@ -66,14 +66,16 @@ private _fnc_onConfirm = { private _currentState = _unit getVariable [QEGVAR(circulation,cardiacArrestType), 0]; private _state = lbCurSel (_display displayCtrl 16112); + + _unit setVariable [QEGVAR(circulation,cardiacArrestType), _state, true]; + if (_state isEqualTo 0) then { - [QACEGVAR(medical,CPRSucceeded), _unit] call CBA_fnc_localEvent; + [QACEGVAR(medical,CPRSucceeded), [_unit], _unit] call CBA_fnc_targetEvent; } else { if (_state > 0 && _currentState isEqualTo 0) then { - [QACEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent; + [QACEGVAR(medical,FatalVitals), [_unit], _unit] call CBA_fnc_targetEvent; }; }; - _unit setVariable [QEGVAR(circulation,cardiacArrestType), _state, true]; }; _display displayAddEventHandler ["unload", _fnc_onUnload];