diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 6006515b45..8e2d0421a7 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -54,7 +54,7 @@ class ACE_Settings { typeName = "SCALAR"; value = 1; }; - class GVAR(enableUnsconsiousnessAI) { + class GVAR(enableUnconsiousnessAI) { value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Enabled", "50/50"}; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index f41ecac36f..70f88fa9b4 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -87,7 +87,7 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 1; }; - class enableUnsconsiousnessAI { + class enableUnconsiousnessAI { displayName = "AI Unconsciousness"; description = "Allow AI to go unconscious"; typeName = "NUMBER"; @@ -97,12 +97,12 @@ class CfgVehicles { value = 0; }; class normal { - name = "Enabled"; + name = "50/50"; value = 1; default = 1; }; - class full { - name = "50/50"; + class full { + name = "Enabled"; value = 2; }; }; diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 25020e227b..ad8fbba18a 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -29,7 +29,7 @@ if !(_activated) exitWith {}; [_logic, QGVAR(enableScreams), "enableScreams"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableUnconsiousnessAI), "enableUnconsiousnessAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(painCoefficient), "painCoefficient"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 60ca184bc9..09b3faf07b 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -46,8 +46,11 @@ if (_unit == ACE_player) then { }; // if we have unconsciousness for AI disabled, we will kill the unit instead -if (!([_unit] call EFUNC(common,IsPlayer)) && (GVAR(enableUnsconsiousnessAI) == 0 || (GVAR(enableUnsconsiousnessAI) == 2 && random(1) <= 0.5))) exitwith { - [_unit, true] call FUNC(setDead); // force, to avoid getting into a loop in case revive is enabled. +if !([_unit] call EFUNC(common,isPlayer)) then { + _enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)]; + if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) exitWith { + [_unit, true] call FUNC(setDead); + }; }; // If a unit has the launcher out, it will sometimes start selecting the primairy weapon while unconscious,