diff --git a/addons/common/functions/fnc_isPlayer.sqf b/addons/common/functions/fnc_isPlayer.sqf
index 772fae1746..91e54a51c1 100644
--- a/addons/common/functions/fnc_isPlayer.sqf
+++ b/addons/common/functions/fnc_isPlayer.sqf
@@ -1,15 +1,21 @@
/*
- * Author: bux578, commy2
+ * Author: bux578, commy2, akalegman
*
* Checks if a unit is a player / curator controlled unit.
* Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine)
*
* Arguments:
* 0: unit to be checked (object)
+ * 1: exclude remote controlled units (boolean)
*
* Return Value:
* Bool: is unit a player?
*/
#include "script_component.hpp"
-isPlayer (_this select 0) || {_this select 0 == call FUNC(player)}
+private ["_unit", "_excludeRemoteControlled"];
+
+_unit = _this select 0;
+_excludeRemoteControlled = if (count _this > 1) then {_this select 1} else {false};
+
+isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)})
diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp
index 6fafbb3612..2b28e91882 100644
--- a/addons/medical/ACE_Settings.hpp
+++ b/addons/medical/ACE_Settings.hpp
@@ -59,6 +59,10 @@ class ACE_Settings {
typeName = "SCALAR";
values[] = {"Disabled", "50/50", "Enabled"};
};
+ class GVAR(remoteControlledAI) {
+ typeName = "BOOL";
+ value = 1;
+ };
class GVAR(preventInstaDeath) {
typeName = "BOOL";
value = 0;
diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp
index 4b4e813545..c8a4528ca5 100644
--- a/addons/medical/CfgVehicles.hpp
+++ b/addons/medical/CfgVehicles.hpp
@@ -106,6 +106,12 @@ class CfgVehicles {
};
};
};
+ class remoteControlledAI {
+ displayName = CSTRING(MedicalSettings_remoteControlledAI_DisplayName);
+ description = CSTRING(MedicalSettings_remoteControlledAI_Description);
+ typeName = "BOOL";
+ defaultValue = 1;
+ };
class preventInstaDeath {
displayName = CSTRING(MedicalSettings_preventInstaDeath_DisplayName);
description = CSTRING(MedicalSettings_preventInstaDeath_Description);
diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf
index 296b4f1d56..00b7a15fcf 100644
--- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf
+++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf
@@ -30,6 +30,7 @@ if !(_activated) exitWith {};
[_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableUnconsciousnessAI), "enableUnconsciousnessAI"] call EFUNC(common,readSettingFromModule);
+[_logic, QGVAR(remoteControlledAI), "remoteControlledAI"] 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 b5360aa8df..3298c0a869 100644
--- a/addons/medical/functions/fnc_setUnconscious.sqf
+++ b/addons/medical/functions/fnc_setUnconscious.sqf
@@ -48,7 +48,7 @@ if (_unit == ACE_player) then {
// if we have unconsciousness for AI disabled, we will kill the unit instead
_isDead = false;
-if (!([_unit] call EFUNC(common,isPlayer)) && !_force) then {
+if (!([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) && !_force) then {
_enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)];
if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) then {
[_unit, true] call FUNC(setDead);
diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml
index 79db900cd0..7eb3ff4c36 100644
--- a/addons/medical/stringtable.xml
+++ b/addons/medical/stringtable.xml
@@ -2886,6 +2886,12 @@
KI kann bewusstlos werden
Umožňuje AI upadnout do bezvědomí
+
+ Remote Controlled AI
+
+
+ Treat remote controlled units as AI not players?
+
Disabled
Отключено