diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index 569d62f890..78471469da 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -54,6 +54,7 @@ _target forceSpeed 0; private _needsBandaging = ([_target] call EFUNC(medical,getBloodLoss)) > 0; private _needsMorphine = (_target getVariable [QEGVAR(medical,pain), 0]) > 0.2; +private _needsEpinephrine = _target getVariable ["ACE_isUnconscious", false]; switch (true) do { case _needsBandaging: { @@ -66,7 +67,7 @@ switch (true) do { }; } forEach _openWounds; private _selection = ["head","body","hand_l","hand_r","leg_l","leg_r"] select _partIndex; - [_target, "Bandage", _selection] call EFUNC(medical,treatmentAdvanced_bandageLocal); + [_this, _target, _selection, "Bandage"] call EFUNC(medical,treatmentAdvanced_bandage); #ifdef DEBUG_MODE_FULL systemChat format ["%1 is bandaging selection %2 on %3", _this, _selection, _target]; @@ -77,7 +78,7 @@ switch (true) do { _this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 5]; }; case _needsMorphine: { - [_target] call EFUNC(medical,treatmentBasic_morphineLocal); + [_this, _target] call EFUNC(medical,treatmentBasic_morphine); [_this, false, false] call FUNC(playTreatmentAnim); _this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2]; @@ -85,4 +86,13 @@ switch (true) do { systemChat format ["%1 is giving %2 morphine", _this, _target]; #endif }; + case _needsEpinephrine: { + [_this, _target] call EFUNC(medical,treatmentBasic_epipen); + [_this, false, false] call FUNC(playTreatmentAnim); + _this setVariable [QGVAR(treatmentOverAt), CBA_missionTime + 2]; + + #ifdef DEBUG_MODE_FULL + systemChat format ["%1 is using an epipen on %2", _this, _target]; + #endif + }; }; diff --git a/addons/medical_ai/functions/fnc_isInjured.sqf b/addons/medical_ai/functions/fnc_isInjured.sqf index 4c25ba72a1..b4bece59d4 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -17,9 +17,9 @@ if !(alive _this) exitWith {false}; -private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss); -private _pain = _this getVariable [QEGVAR(medical,pain), 0]; -// Advanced only? +private _bloodLoss = [_this] call EFUNC(medical,getBloodLoss); +private _pain = _this getVariable [QEGVAR(medical,pain), 0]; +private _unconscious = _this getVariable ["ACE_isUnconscious", false]; // private _heartRate = _this getVariable [QEGVAR(medical,heartRate), 70]; -(_bloodLoss > 0) || {_pain > 0.2} // || {_heartRate > 100} || {_heartRate < 40} +(_bloodLoss > 0) || {_pain > 0.2} || _unconscious // || {_heartRate > 100} || {_heartRate < 40}