diff --git a/addons/captives/CfgEventHandlers.hpp b/addons/captives/CfgEventHandlers.hpp index eb08f7e865..b8c182d1f6 100644 --- a/addons/captives/CfgEventHandlers.hpp +++ b/addons/captives/CfgEventHandlers.hpp @@ -23,7 +23,7 @@ class Extended_GetIn_EventHandlers { class Extended_GetOut_EventHandlers { class All { class GVAR(AutoDetachCaptive) { - getOut = "if (local (_this select 2) && {(_this select 2) getVariable ['ACE_isCaptive', false]}) then {_this call ACE_Captives_fnc_handleGetOut}"; + getOut = QUOTE(_this call FUNC(handleGetOut)); }; }; }; diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 3036ccf196..8758788b2a 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -5,62 +5,62 @@ class CfgVehicles { class ACE_SetCaptive { displayName = "$STR_ACE_Captives_SetCaptive"; distance = 4; - condition = "'ACE_CableTie' in items _player && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])}"; - statement = "player removeItem 'ACE_CableTie'; [_target, true] call ACE_Captives_fnc_setCaptive"; + condition = QUOTE(('ACE_CableTie' in (items _player)) && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])}); + statement = QUOTE(_player removeItem 'ACE_CableTie'; [ARR_2(_target, true)] call FUNC(setCaptive);); showDisabled = 0; priority = 2.4; - icon = "\ACE_Captives\UI\handcuff_ca.paa"; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); hotkey = "C"; }; class ACE_ReleaseCaptive { displayName = "$STR_ACE_Captives_ReleaseCaptive"; distance = 4; - condition = "_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)}"; - statement = "[_target, false] call ACE_Captives_fnc_setCaptive"; + condition = QUOTE(_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)}); + statement = QUOTE([ARR_2(_target, false)] call FUNC(setCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; priority = 2.4; - icon = "\ACE_Captives\UI\handcuff_ca.paa"; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); hotkey = "R"; }; class ACE_EscortCaptive { displayName = "$STR_ACE_Captives_EscortCaptive"; distance = 4; - condition = "_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['ACE_isUnconscious', false])}"; - statement = "[_target, true] call ACE_Captives_fnc_escortCaptive"; + condition = QUOTE((_target getVariable ['ACE_isCaptive', false]) && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['ACE_isUnconscious', false])}); + statement = QUOTE([ARR_2(_target, true)] call FUNC(escortCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; - icon = "\ACE_Captives\UI\captive_ca.paa"; + icon = QUOTE(PATHTOF(UI\captive_ca.paa)); priority = 2.3; hotkey = "E"; }; class ACE_StopEscorting { displayName = "$STR_ACE_Captives_StopEscorting"; distance = 4; - condition = "_target getVariable ['ACE_isCaptive', false] && {_target in attachedObjects _player}"; - statement = "[_target, false] call ACE_Captives_fnc_escortCaptive"; + condition = QUOTE((_target getVariable ['ACE_isCaptive', false]) && {_target in (attachedObjects _player)}); + statement = QUOTE([ARR_2(_target, false)] call FUNC(escortCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; - icon = "\ACE_Captives\UI\captive_ca.paa"; + icon = QUOTE(PATHTOF(UI\captive_ca.paa)); priority = 2.3; hotkey = "E"; }; class ACE_LoadCaptive { displayName = "$STR_ACE_Captives_LoadCaptive"; distance = 4; - condition = "[_player, _target, objNull] call ACE_Captives_fnc_canLoadCaptive"; - statement = "[_player, _target, objNull] call ACE_Captives_fnc_loadCaptive"; + condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive)); + statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(loadCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; - icon = "\ACE_Captives\UI\captive_ca.paa"; + icon = QUOTE(PATHTOF(UI\captive_ca.paa)); priority = 2.2; hotkey = "L"; }; class ACE_FriskPerson { displayName = "$STR_ACE_Captives_FriskPerson"; distance = 2; - condition = "[_player, _target] call ACE_Captives_fnc_canFriskPerson"; - statement = "[_player, _target] call ACE_Captives_fnc_openFriskMenu"; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(openFriskMenu)); showDisabled = 0; //icon = ""; //@todo priority = 3; @@ -71,8 +71,8 @@ class CfgVehicles { class ACE_SelfActions { class ACE_StopEscortingSelf { displayName = "$STR_ACE_Captives_StopEscorting"; - condition = "(_player getVariable ['ACE_escortedUnit', objNull]) getVariable ['ACE_isCaptive', false] && {(_player getVariable ['ACE_escortedUnit', objNull]) in attachedObjects _player}"; - statement = "[_player getVariable ['ACE_escortedUnit', objNull], false] call ACE_Captives_fnc_escortCaptive;"; + condition = QUOTE(((_player getVariable ['ACE_escortedUnit', objNull]) getVariable ['ACE_isCaptive', false]) && {(_player getVariable ['ACE_escortedUnit', objNull]) in attachedObjects _player}); + statement = QUOTE([ARR_2((_player getVariable ['ACE_escortedUnit', objNull]), false)] call FUNC(_escortCaptive);); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; priority = 2.3; @@ -95,8 +95,8 @@ class CfgVehicles { class ACE_LoadCaptive { \ displayName = "$STR_ACE_Captives_LoadCaptive"; \ distance = 4; \ - condition = "[_player, objNull, _target] call ACE_Captives_fnc_canLoadCaptive"; \ - statement = "[_player, objNull, _target] call ACE_Captives_fnc_loadCaptive"; \ + condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ + statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(loadCaptive)); \ exceptions[] = {"ACE_Interaction_isNotEscorting"}; \ showDisabled = 0; \ priority = 1.2; \ @@ -105,8 +105,8 @@ class CfgVehicles { class ACE_UnloadCaptive { \ displayName = "$STR_ACE_Captives_UnloadCaptive"; \ distance = 4; \ - condition = "[_player, _target] call ACE_Captives_fnc_canUnloadCaptive"; \ - statement = "[_player, _target] call ACE_Captives_fnc_unloadCaptive"; \ + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ + statement = QUOTE([ARR_2(_player, _target)] call FUNC(unloadCaptive)); \ showDisabled = 0; \ priority = 1.2; \ hotkey = "C"; \ diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index 5e6f35bc48..7f83ce4fad 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -1,8 +1,7 @@ #include "script_component.hpp" ADDON = false; - -PREP(empty); + PREP(canFriskPerson); PREP(canLoadCaptive); PREP(canUnloadCaptive); diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index 7aaa310183..7e5c3382bb 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -13,6 +13,9 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgMoves.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" class ACE_Core_canInteractConditions { diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index 7cc1fd6f5c..f734fa0177 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -1,9 +1,10 @@ /* * Author: commy2 - * X + * Handles when a captive unit gets out of a vehicle. * * Arguments: * 0: _vehicle + * 2: dunno * 1: _unit * * Return Value: @@ -16,14 +17,18 @@ */ #include "script_component.hpp" -PARAMS_2(_vehicle,_unit); +PARAMS_3(_vehicle,_dontcare,_unit); + +if (!local _unit) exitWith {}; +if (!(_unit getVariable ["ACE_isCaptive", false])) exitWith {}; private ["_cargoIndex"]; _cargoIndex = _unit getVariable ["ACE_Captives_CargoIndex", -1]; +//If captive was not "unloaded", then move them back into the vehicle. if (_cargoIndex != -1) exitWith { _unit moveInCargo [_vehicle, _cargoIndex]; }; -[_unit, 'ACE_AmovPercMstpScapWnonDnon', 2] call EFUNC(common,doAnimation); +[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_loadCaptive.sqf b/addons/captives/functions/fnc_loadCaptive.sqf index 255581a593..f2b1a9a0c1 100644 --- a/addons/captives/functions/fnc_loadCaptive.sqf +++ b/addons/captives/functions/fnc_loadCaptive.sqf @@ -20,9 +20,9 @@ PARAMS_1(_unit,_target,_vehicle); if (isNull _target) then { - _objects = attachedObjects _unit; - _objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter); - _target = _objects select 0; + // _objects = attachedObjects _unit; + // _objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter); + // _target = _objects select 0; }; if (isNull _vehicle) then { diff --git a/addons/captives/functions/fnc_unloadCaptive.sqf b/addons/captives/functions/fnc_unloadCaptive.sqf index 01e1d48e74..e6eb4b24a5 100644 --- a/addons/captives/functions/fnc_unloadCaptive.sqf +++ b/addons/captives/functions/fnc_unloadCaptive.sqf @@ -25,11 +25,11 @@ _cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turr _cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter); if (count _cargo > 0) then { - _target = _cargo select 0; + _target = _cargo select 0; - _target setVariable ["ACE_Captives_CargoIndex", -1, true]; + _target setVariable ["ACE_Captives_CargoIndex", -1, true]; - moveOut _target; - [_target, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); - [_target, "{unassignVehicle _this}", _target] call ACE_Core_fnc_execRemoteFnc; + moveOut _target; + [_target, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation); + [_target, "{unassignVehicle _this}", _target] call ACE_Core_fnc_execRemoteFnc; }; diff --git a/addons/captives/functions/script_component.hpp b/addons/captives/functions/script_component.hpp index 3cc9111162..e91d5c843b 100644 --- a/addons/captives/functions/script_component.hpp +++ b/addons/captives/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\addons\blank\script_component.hpp" \ No newline at end of file +#include "\z\ace\addons\captives\script_component.hpp" \ No newline at end of file