diff --git a/addons/breathing/functions/fnc_gui_updateInjuryListPart.sqf b/addons/breathing/functions/fnc_gui_updateInjuryListPart.sqf index f17cf75a2..99c20b161 100644 --- a/addons/breathing/functions/fnc_gui_updateInjuryListPart.sqf +++ b/addons/breathing/functions/fnc_gui_updateInjuryListPart.sqf @@ -22,11 +22,7 @@ params ["_ctrl", "_target", "_selectionN", "_entries"]; if (GVAR(showCyanosis) && _selectionN in [0,2,3]) then { private _spO2 = 0; - - if (alive _target) then { - _spO2 = GET_KAT_SPO2(_target); - }; - + _spO2 = GET_KAT_SPO2(_target); if (_spO2 <= GVAR(slightValue) || HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then { private _cyanosisArr = switch (true) do { case (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)); diff --git a/addons/vitals/XEH_postInit.sqf b/addons/vitals/XEH_postInit.sqf index d215eafd4..8959ee702 100644 --- a/addons/vitals/XEH_postInit.sqf +++ b/addons/vitals/XEH_postInit.sqf @@ -4,3 +4,21 @@ [QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler; [QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler; +["ace_medical_death", { + params ["_unit"]; + [{ + params ["_args", "_idPFH"]; + _args params ["_unit"]; + private _alive = alive _unit; + if (_alive) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + private _bg = _unit getVariable [VAR_BLOOD_GAS, DEFAULT_BLOOD_GAS]; + private _spo2 = (_bg select 2) - 0.005; + if (_spo2 < 0.01) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + }; + _bg set [2, _spo2]; + _unit setVariable [VAR_BLOOD_GAS, _bg, true]; +}, 10, [_unit]] call CBA_fnc_addPerFrameHandler; +}] call CBA_fnc_addEventHandler; \ No newline at end of file