diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp
index 934e1215d2..d292402bcf 100644
--- a/addons/captives/CfgVehicles.hpp
+++ b/addons/captives/CfgVehicles.hpp
@@ -78,7 +78,7 @@ class CfgVehicles {
showDisabled = 0;
priority = 2.3;
hotkey = "C";
- };
+ };
class ACE_StartSurrenderingSelf {
displayName = "$STR_ACE_Captives_StartSurrendering";
condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender));
@@ -86,7 +86,7 @@ class CfgVehicles {
exceptions[] = {};
showDisabled = 0;
priority = 0;
- };
+ };
class ACE_StopSurrenderingSelf {
displayName = "$STR_ACE_Captives_StopSurrendering";
condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender));
@@ -162,4 +162,30 @@ class CfgVehicles {
MACRO_ADDITEM(ACE_CableTie,12)
};
};
+
+
+ class Logic;
+ class Module_F: Logic {
+ class ArgumentsBaseUnits {};
+ class ModuleDescription {};
+ };
+
+ class GVAR(ModuleSurrender): Module_F {
+ author = "$STR_ACE_Common_ACETeam";
+ category = "ACE";
+ displayName = "Make Unit Surrender";
+ function = QUOTE(DFUNC(moduleSurrender));
+ scope = 2; //show in editor
+ scopeCurator = 2; //show in zeus
+ curatorCost = 0; //???
+ isGlobal = 1; //run global
+ isTriggerActivated = 1; //Wait for triggers
+ // icon = QUOTE(PATHTOF(ui\todo.paa));
+ functionPriority = 0;
+ class Arguments {};
+ class ModuleDescription: ModuleDescription {
+ description = "Sync a unit to make them surrender.
Source: ace_captives";
+ sync[] = {"AnyAI"};
+ };
+ };
};
diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf
index a98bf73443..75ee77e9bc 100644
--- a/addons/captives/XEH_preInit.sqf
+++ b/addons/captives/XEH_preInit.sqf
@@ -23,6 +23,7 @@ PREP(handleKnockedOut);
PREP(handlePlayerChanged);
PREP(handleUnitInitPost);
PREP(handleWokeUp);
+PREP(moduleSurrender);
PREP(setHandcuffed);
PREP(surrender);
PREP(vehicleCaptiveMoveIn);
diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp
index c0a34e3222..27b7c4ec60 100644
--- a/addons/captives/config.cpp
+++ b/addons/captives/config.cpp
@@ -2,7 +2,7 @@
class CfgPatches {
class ADDON {
- units[] = {};
+ units[] = {QGVAR(ModuleSurrender)};
weapons[] = {"ACE_CableTie"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_Interaction"};
diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf
index 9c4f02546f..13e284ef80 100644
--- a/addons/captives/functions/fnc_handlePlayerChanged.sqf
+++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf
@@ -18,8 +18,10 @@
PARAMS_2(_newUnit,_oldUnit);
-if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then {
- showHUD false;
+if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {
+ TRACE_1("Player Change (showHUD false)",_newUnit);
+ showHUD false;
} else {
+ TRACE_1("Player Change (showHUD true)",_newUnit);
showHUD true;
};
diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf
new file mode 100644
index 0000000000..5cbf43aacc
--- /dev/null
+++ b/addons/captives/functions/fnc_moduleSurrender.sqf
@@ -0,0 +1,46 @@
+/*
+ * Author: PabstMirror
+ * Module Function to make a unit surrender (can be called from editor, or placed with zeus)
+ *
+ * Arguments:
+ * 0: The Module Logic Object