diff --git a/addons/circulation/XEH_postInit.sqf b/addons/circulation/XEH_postInit.sqf index 9e9aca0f1..a904f59e8 100644 --- a/addons/circulation/XEH_postInit.sqf +++ b/addons/circulation/XEH_postInit.sqf @@ -24,4 +24,10 @@ GVAR(AEDX_MonitorTarget) = objNull; [QACEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent; _unit setVariable [QGVAR(cardiacArrestType), 1, true]; +}] call CBA_fnc_addEventHandler; + +[QGVAR(bloodPoisoning), { + params ["_unit"]; + + [QACEGVAR(medical,FatalVitals), _unit] call CBA_fnc_localEvent; }] call CBA_fnc_addEventHandler; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf b/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf index 0476ffde5..2097f9f7c 100644 --- a/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf +++ b/addons/circulation/functions/fnc_treatmentAdvanced_IV.sqf @@ -16,11 +16,25 @@ * Public: No */ -params ["_className", "_target"]; +params ["_className", "_unit"]; //unit, adjustment, time private _volume = getNumber (configFile >> "ACE_Medical_Treatment" >> "IV" >> _className >> "volume"); -private _hradjust = -(_volume / 4); +private _hradjust = -_volume; -[_target, "BloodPoisoning", 150, 300, _hradjust, 0, -10] call ACEFUNC(medical_status,addMedicationAdjustment); +[_unit, "BloodPoisoning", 150, 300, _hradjust, 0, -10] call ACEFUNC(medical_status,addMedicationAdjustment); + +[{ + params ["_unit"]; + + if !(_unit getVariable [VAR_CRDC_ARRST, false]) then { + private _medicationArray = _unit getVariable [QACEGVAR(medical,medications), []]; + private _index = _medicationArray findIf {(_x select 0) isEqualTo "BloodPoisoning"}; + + if (_index > -1) then { + [QGVAR(bloodPoisoning), _unit, _unit] call CBA_fnc_targetEvent; + }; + }; + +}, [_unit], 150] call CBA_fnc_waitAndExecute; \ No newline at end of file