From 40634318f00977c5047945cf7f2e09cea9ee8e04 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 23 Aug 2015 23:41:35 -0500 Subject: [PATCH] Move RemoveHandcuffs to Main (always blocked by hands) --- addons/captives/CfgVehicles.hpp | 32 +++++++++---------- .../functions/fnc_canRemoveHandcuffs.sqf | 3 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 774ecf87e3..afda86cfda 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -12,17 +12,17 @@ class CfgVehicles { exceptions[] = {}; icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); }; - class ACE_RemoveHandcuffs { - displayName = CSTRING(ReleaseCaptive); - selection = "righthand"; - distance = 2; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); - exceptions[] = {}; - icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); - }; class ACE_MainActions { + class ACE_RemoveHandcuffs { + displayName = CSTRING(ReleaseCaptive); + selection = "righthand"; + distance = 2; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); + exceptions[] = {}; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); + }; class ACE_EscortCaptive { displayName = CSTRING(EscortCaptive); distance = 4; @@ -97,7 +97,7 @@ class CfgVehicles { }; }; -#define MACRO_LOADUNLOADCAPTIVE \ +#define MACRO_LOADCAPTIVE \ class ACE_Actions { \ class ACE_MainActions { \ class GVAR(LoadCaptive) { \ @@ -113,27 +113,27 @@ class CfgVehicles { class LandVehicle; class Car: LandVehicle { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Tank: LandVehicle { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Air; class Helicopter: Air { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Plane: Air { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Ship; class Ship_F: Ship { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class StaticWeapon: LandVehicle { - MACRO_LOADUNLOADCAPTIVE + MACRO_LOADCAPTIVE }; class Box_NATO_Support_F; diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index e8bbe3b50e..e36ba5cd5b 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -20,4 +20,5 @@ params ["_unit", "_target"]; //Unit is handcuffed and not currently being escorted _target getVariable [QGVAR(isHandcuffed), false] && -{isNull (attachedTo _target)} +{isNull (attachedTo _target)} && +{(vehicle _target) == _target}