diff --git a/addons/captives/CfgMoves.hpp b/addons/captives/CfgMoves.hpp index da43b21aae..ab379de6ae 100644 --- a/addons/captives/CfgMoves.hpp +++ b/addons/captives/CfgMoves.hpp @@ -1,90 +1,90 @@ class CfgMovesBasic { - class Actions { - class CivilStandActions; - class ACE_CivilStandCaptiveActions: CivilStandActions { - turnL = ""; - turnR = ""; - stop = "ACE_AmovPercMstpScapWnonDnon"; - StopRelaxed = "ACE_AmovPercMstpScapWnonDnon"; - default = "ACE_AmovPercMstpScapWnonDnon"; - getOver = ""; - throwPrepare = ""; - throwGrenade[] = {"","Gesture"}; + class Actions { + class CivilStandActions; + class ACE_CivilStandCaptiveActions: CivilStandActions { + turnL = ""; + turnR = ""; + stop = "ACE_AmovPercMstpScapWnonDnon"; + StopRelaxed = "ACE_AmovPercMstpScapWnonDnon"; + default = "ACE_AmovPercMstpScapWnonDnon"; + getOver = ""; + throwPrepare = ""; + throwGrenade[] = {"","Gesture"}; + }; }; - }; }; class CfgMovesMaleSdr: CfgMovesBasic { - class StandBase; - class States { - class AmovPercMstpSnonWnonDnon: StandBase { - ConnectTo[] += {"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; - }; + class StandBase; + class States { + class AmovPercMstpSnonWnonDnon: StandBase { + ConnectTo[] += {"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; + }; - class CutSceneAnimationBase; - class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase { - actions = "ACE_CivilStandCaptiveActions"; - file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_EaseIn"; - speed = 1; - looped = 0; - interpolationRestart = 2; - ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; - InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; - }; + class CutSceneAnimationBase; + class ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon: CutSceneAnimationBase { + actions = "ACE_CivilStandCaptiveActions"; + file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_EaseIn"; + speed = 1; + looped = 0; + interpolationRestart = 2; + ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon",0.1}; + InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + }; - class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { - file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; - speed = 0; - ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; - InterpolateTo[] = {"Unconscious",0.01}; - looped = 1; - }; + class ACE_AmovPercMstpScapWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { + file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\AmovPercMstpSnonWnonDnon_Ease"; + speed = 0; + ConnectTo[] = {"ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + InterpolateTo[] = {"Unconscious",0.01}; + looped = 1; + }; - class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { - actions = "CivilStandActions"; - file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout"; - ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; - InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; + class ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon: ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon { + actions = "CivilStandActions"; + file = "\A3\anims_f\Data\Anim\Sdr\mov\erc\stp\non\non\amovpercmstpsnonwnondnon_easeout"; + ConnectTo[] = {"AmovPercMstpSnonWnonDnon",0.1}; + InterpolateTo[] = {"Unconscious",0.01,"ACE_AmovPercMstpSnonWnonDnon_AmovPercMstpScapWnonDnon",0.1}; + }; }; - }; }; /* player playMove "ACE_AmovPercMstpScapWnonDnon"; player switchMove "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon"; -*/ + */ /*class CfgMovesBasic; class CfgMovesMaleSdr: CfgMovesBasic { - class States { +class States { class CutSceneAnimationBase; class AmovPercMstpSnonWnonDnon_EaseIn: CutSceneAnimationBase { - head = "headDefault"; - static = 1; - disableWeapons = 0; - forceAim = 0; - InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseOut",0.02,"Unconscious",0.1}; + head = "headDefault"; + static = 1; + disableWeapons = 0; + forceAim = 0; + InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseOut",0.02,"Unconscious",0.1}; }; class AmovPercMstpSnonWnonDnon_Ease: AmovPercMstpSnonWnonDnon_EaseIn { - looped = 1; - InterpolateTo[] = {"Unconscious",0.1}; + looped = 1; + InterpolateTo[] = {"Unconscious",0.1}; }; class AmovPercMstpSnonWnonDnon_EaseOut: AmovPercMstpSnonWnonDnon_EaseIn { - InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseIn",0.02,"Unconscious",0.1}; + InterpolateTo[] = {"AmovPercMstpSnonWnonDnon_EaseIn",0.02,"Unconscious",0.1}; }; class AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon: CutSceneAnimationBase { - InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; + InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon",0.1}; }; class AmovPercMstpSsurWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { - looped = 1; - InterpolateTo[] = {"Unconscious",0.01}; + looped = 1; + InterpolateTo[] = {"Unconscious",0.01}; }; class AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon: AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon { - InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1}; + InterpolateTo[] = {"Unconscious",0.01,"AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon",0.1}; }; - }; +}; };*/ diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index dd4f6361d7..04b8d4569f 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -5,8 +5,8 @@ class CfgVehicles { class ACE_SetCaptive { displayName = "$STR_ACE_Captives_SetCaptive"; distance = 4; - condition = QUOTE(('ACE_CableTie' in (items _player)) && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])}); - statement = QUOTE(_player removeItem 'ACE_CableTie'; [ARR_3(QGVAR(SetCaptive), [_target], [ARR_2(_target, true)])] call EFUNC(common,targetEvent);); + condition = QUOTE(('ACE_CableTie' in (items _player)) && {alive _target} && {!(_target getVariable [ARR_2('ACE_isCaptive', false)])}); + statement = QUOTE(_player removeItem 'ACE_CableTie'; [ARR_3('SetCaptive', [_target], [ARR_2(_target, true)])] call EFUNC(common,targetEvent);); showDisabled = 0; priority = 2.4; icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); @@ -15,8 +15,8 @@ class CfgVehicles { class ACE_ReleaseCaptive { displayName = "$STR_ACE_Captives_ReleaseCaptive"; distance = 4; - condition = QUOTE(_target getVariable ['ACE_isCaptive', false] && {isNull (attachedTo _target)}); - statement = QUOTE([ARR_2(_target, false)] call FUNC(setCaptive)); + condition = QUOTE(_target getVariable [ARR_2('ACE_isCaptive', false)] && {isNull (attachedTo _target)}); + statement = QUOTE([ARR_3('SetCaptive', [_target], [ARR_2(_target, false)])] call EFUNC(common,targetEvent);); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; priority = 2.4; @@ -26,7 +26,7 @@ class CfgVehicles { class ACE_EscortCaptive { displayName = "$STR_ACE_Captives_EscortCaptive"; distance = 4; - condition = QUOTE((_target getVariable ['ACE_isCaptive', false]) && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable ['ACE_isUnconscious', false])}); + condition = QUOTE((_target getVariable [ARR_2('ACE_isCaptive', false)]) && {isNull (attachedTo _target)} && {alive _target} && {!(_target getVariable [ARR_2('ACE_isUnconscious', false)])}); statement = QUOTE([ARR_2(_target, true)] call FUNC(escortCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; @@ -37,7 +37,7 @@ class CfgVehicles { class ACE_StopEscorting { displayName = "$STR_ACE_Captives_StopEscorting"; distance = 4; - condition = QUOTE((_target getVariable ['ACE_isCaptive', false]) && {_target in (attachedObjects _player)}); + condition = QUOTE((_target getVariable [ARR_2('ACE_isCaptive', false)]) && {_target in (attachedObjects _player)}); statement = QUOTE([ARR_2(_target, false)] call FUNC(escortCaptive)); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; @@ -71,8 +71,8 @@ class CfgVehicles { class ACE_SelfActions { class ACE_StopEscortingSelf { displayName = "$STR_ACE_Captives_StopEscorting"; - 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);); + condition = QUOTE(((_player getVariable [ARR_2('ACE_escortedUnit', objNull)]) getVariable ['ACE_isCaptive', false]) && {(_player getVariable [ARR_2('ACE_escortedUnit', objNull)]) in attachedObjects _player}); + statement = QUOTE([ARR_2((_player getVariable [ARR_2('ACE_escortedUnit', objNull)]), false)] call FUNC(_escortCaptive);); exceptions[] = {"ACE_Interaction_isNotEscorting"}; showDisabled = 0; priority = 2.3; diff --git a/addons/captives/CfgWeapons.hpp b/addons/captives/CfgWeapons.hpp index 3005a2fa5c..be2149ca88 100644 --- a/addons/captives/CfgWeapons.hpp +++ b/addons/captives/CfgWeapons.hpp @@ -1,15 +1,15 @@ class CfgWeapons { - class ACE_ItemCore; - class InventoryItem_Base_F; + class ACE_ItemCore; + class InventoryItem_Base_F; - class ACE_CableTie: ACE_ItemCore { - displayName = "$STR_ACE_Captives_CableTie"; - descriptionShort = "$STR_ACE_Captives_CableTieDescription"; - model = QUOTE(PATHTOF(models\ace_cabletie.p3d)); - picture = QUOTE(PATHTOF(UI\ace_cabletie_ca.paa)); - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 1; + class ACE_CableTie: ACE_ItemCore { + displayName = "$STR_ACE_Captives_CableTie"; + descriptionShort = "$STR_ACE_Captives_CableTieDescription"; + model = QUOTE(PATHTOF(models\ace_cabletie.p3d)); + picture = QUOTE(PATHTOF(UI\ace_cabletie_ca.paa)); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + }; }; - }; }; diff --git a/addons/captives/README.md b/addons/captives/README.md new file mode 100644 index 0000000000..3938720f08 --- /dev/null +++ b/addons/captives/README.md @@ -0,0 +1,14 @@ +ace_captives +============ + +Allows taking people captive/handcuffed + +####Items: +`ACE_CableTie` - adds ability to take someone captive + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/captives/XEH_postInitClient.sqf b/addons/captives/XEH_postInitClient.sqf index a461b36aeb..ccec1d39d2 100644 --- a/addons/captives/XEH_postInitClient.sqf +++ b/addons/captives/XEH_postInitClient.sqf @@ -1,9 +1,19 @@ -// by commy2 +#include "script_component.hpp" [missionNamespace, "playerChanged", {_this call ACE_Captives_fnc_handlePlayerChanged}] call ACE_Core_fnc_addCustomEventhandler; -[QGVAR(MoveIn), {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); -[QGVAR(MoveOut), {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); -[QGVAR(SetCaptive), {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); +["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); +["MoveOutCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); +["SetCaptive", {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler); + +//TODO: Medical Integration Events??? + +// [_unit, "knockedOut", { + // if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut}; +// }] call ACE_Core_fnc_addCustomEventhandler; + +// [_unit, "wokeUp", { + // if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp}; +// }] call ACE_Core_fnc_addCustomEventhandler; diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index 7f83ce4fad..505d57051e 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -17,5 +17,7 @@ PREP(openFriskMenu); PREP(setCaptive); PREP(surrender); PREP(unloadCaptive); +PREP(vehicleCaptiveMoveIn); +PREP(vehicleCaptiveMoveOut); ADDON = true; diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index fea03cfe16..f23e380dd3 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -19,7 +19,7 @@ PARAMS_2(_unit,_oldUnit); if (_unit getVariable ["ACE_isCaptive", false]) then { - showHUD false; + showHUD false; } else { - showHUD true; + showHUD true; }; diff --git a/addons/captives/functions/fnc_handleWokeUp.sqf b/addons/captives/functions/fnc_handleWokeUp.sqf index cbcd2a07ae..ea6a1bcb26 100644 --- a/addons/captives/functions/fnc_handleWokeUp.sqf +++ b/addons/captives/functions/fnc_handleWokeUp.sqf @@ -18,6 +18,6 @@ PARAMS_1(_unit); if (_unit getVariable ["ACE_isCaptive", false] && {vehicle _unit == _unit}) then { - [_unit] call EFUNC(common,fixLoweredRifleAnimation); - [_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation); + [_unit] call EFUNC(common,fixLoweredRifleAnimation); + [_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_initPost.sqf b/addons/captives/functions/fnc_initPost.sqf index 5c116be417..8e777a9717 100644 --- a/addons/captives/functions/fnc_initPost.sqf +++ b/addons/captives/functions/fnc_initPost.sqf @@ -19,6 +19,6 @@ PARAMS_1(_unit); // reset status on mission start if (_unit getVariable ["ACE_isCaptive", false]) then { - _unit setVariable ["ACE_isCaptive", false]; - [_unit, true] call ACE_Captives_fnc_setCaptive; + _unit setVariable ["ACE_isCaptive", false]; + [_unit, true] call ACE_Captives_fnc_setCaptive; }; diff --git a/addons/captives/functions/fnc_initUnit.sqf b/addons/captives/functions/fnc_initUnit.sqf index 13777dca1d..df9356ff2a 100644 --- a/addons/captives/functions/fnc_initUnit.sqf +++ b/addons/captives/functions/fnc_initUnit.sqf @@ -17,13 +17,6 @@ PARAMS_1(_unit); -[_unit, "knockedOut", { - if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut}; -}] call ACE_Core_fnc_addCustomEventhandler; - -[_unit, "wokeUp", { - if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp}; -}] call ACE_Core_fnc_addCustomEventhandler; // prevent players from throwing grenades -[_unit, "Throw", {(_this select 1) getVariable ["ACE_isCaptive", false]}, {}] call ACE_Core_fnc_addActionEventhandler; +[_unit, "Throw", {(_this select 1) getVariable ["ACE_isCaptive", false]}, {}] call EFUNC(common,addActionEventhandler); diff --git a/addons/captives/functions/fnc_loadCaptive.sqf b/addons/captives/functions/fnc_loadCaptive.sqf index 2648255c3b..05f87a20c6 100644 --- a/addons/captives/functions/fnc_loadCaptive.sqf +++ b/addons/captives/functions/fnc_loadCaptive.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit,_target,_vehicle); +PARAMS_3(_unit,_target,_vehicle); if (isNull _target) then { _objects = attachedObjects _unit; @@ -32,5 +32,5 @@ if (isNull _vehicle) then { if ((!isNil "_target") && {!isNil "_vehicle"}) then { _unit setVariable ["ACE_isEscorting", false]; - [QGVAR(MoveIn), [_target], [_target, _vehicle]] call EFUNC(common,targetEvent); + ["MoveInCaptive", [_target], [_target, _vehicle]] call EFUNC(common,targetEvent); }; diff --git a/addons/captives/functions/fnc_openFriskMenu.sqf b/addons/captives/functions/fnc_openFriskMenu.sqf index 42dda4ab66..d69dbd045c 100644 --- a/addons/captives/functions/fnc_openFriskMenu.sqf +++ b/addons/captives/functions/fnc_openFriskMenu.sqf @@ -22,7 +22,7 @@ PARAMS_2(_player,_unit); _weapon = currentWeapon _player; if (_weapon == primaryWeapon _player && {_weapon != ""}) then { - [_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation); + [_player, "AmovPercMstpSlowWrflDnon", 0] call EFUNC(common,doAnimation); }; _listedItemClasses = []; @@ -32,19 +32,19 @@ _actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Capti _allGear = []; if ((handgunWeapon _unit) != "") then { - _allGear pushBack (handgunWeapon _unit); + _allGear pushBack (handgunWeapon _unit); }; if (count (uniformItems _unit) > 0) then { - _allGear = _allGear + (uniformItems _unit); + _allGear = _allGear + (uniformItems _unit); }; if (count (vestItems _unit) > 0) then { - _allGear = _allGear + (vestItems _unit); + _allGear = _allGear + (vestItems _unit); }; if (count (backpackItems _unit) > 0) then { - _allGear = _allGear + (backpackItems _unit); + _allGear = _allGear + (backpackItems _unit); }; if (count (assignedItems _unit) > 0) then { - _allGear = _allGear + (assignedItems _unit); + _allGear = _allGear + (assignedItems _unit); }; // Handgun @@ -53,15 +53,15 @@ if (count (assignedItems _unit) > 0) then { // Backpack Items // Assigned Items { - if (!(_x in _listedItemClasses)) then { - private "_item"; - _item = configFile >> "CfgMagazines" >> _x; - if (isNil "_item" || str _item == "") then { //str _item ? - _item = configFile >> "CfgWeapons" >> _x; + if (!(_x in _listedItemClasses)) then { + private "_item"; + _item = configFile >> "CfgMagazines" >> _x; + if (isNil "_item" || str _item == "") then { //str _item ? + _item = configFile >> "CfgWeapons" >> _x; + }; + _actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call ACE_Interaction_fnc_addSelectableItem; + _listedItemClasses pushBack _x; }; - _actions = [_actions, getText(_item >> "displayName"), getText(_item >> "picture"), _x] call ACE_Interaction_fnc_addSelectableItem; - _listedItemClasses pushBack _x; - }; } forEach (_allGear); [_actions, {call ACE_Interaction_fnc_hideMenu;}, {call ACE_Interaction_fnc_hideMenu;}] call ACE_Interaction_fnc_openSelectMenu; diff --git a/addons/captives/functions/fnc_surrender.sqf b/addons/captives/functions/fnc_surrender.sqf index b308775040..92f0ea416a 100644 --- a/addons/captives/functions/fnc_surrender.sqf +++ b/addons/captives/functions/fnc_surrender.sqf @@ -21,43 +21,43 @@ PARAMS_2(_unit,_state); if (!local _unit) exitWith {[_this, _fnc_scriptName, _unit] call ACE_Core_fnc_execRemoteFnc}; if (_state) then { - if (_unit getVariable ["ACE_isSurrender", false]) exitWith {}; + if (_unit getVariable ["ACE_isSurrender", false]) exitWith {}; - _unit setVariable ["ACE_isSurrender", true, true]; - [_unit, "ACE_Surrendered", true] call ACE_Core_fnc_setCaptivityStatus; + _unit setVariable ["ACE_isSurrender", true, true]; + [_unit, "ACE_Surrendered", true] call ACE_Core_fnc_setCaptivityStatus; - _unit spawn { - // fix for lowered rifle animation glitch - if (currentWeapon _this != "" && {currentWeapon _this == primaryWeapon _this} && {weaponLowered _this} && {stance _this == "STAND"}) then { - _this playMove "amovpercmstpsraswrfldnon"; + _unit spawn { + // fix for lowered rifle animation glitch + if (currentWeapon _this != "" && {currentWeapon _this == primaryWeapon _this} && {weaponLowered _this} && {stance _this == "STAND"}) then { + _this playMove "amovpercmstpsraswrfldnon"; + }; + + while {_this getVariable ["ACE_isSurrender", false]} do { + sleep 0.001; //sleep in UI + + if (isPlayer _this) then {showHUD false}; + + if (!alive _this || {_this getVariable ["ACE_isUnconscious", false]}) then { + _this setVariable ["ACE_isSurrender", false, true]; + } else { + _this playMove "amovpercmstpsnonwnondnon_amovpercmstpssurwnondnon"; + }; + }; + if !(_this getVariable ["ACE_isUnconscious", false]) then { + _this playMoveNow "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"; + } else { + _this playMoveNow "unconscious"; + }; + + [_this, "ACE_Surrendered", false] call ACE_Core_fnc_setCaptivityStatus; + + if (isPlayer _this) then {showHUD true}; }; - - while {_this getVariable ["ACE_isSurrender", false]} do { - sleep 0.001; //sleep in UI - - if (isPlayer _this) then {showHUD false}; - - if (!alive _this || {_this getVariable ["ACE_isUnconscious", false]}) then { - _this setVariable ["ACE_isSurrender", false, true]; - } else { - _this playMove "amovpercmstpsnonwnondnon_amovpercmstpssurwnondnon"; - }; - }; - if !(_this getVariable ["ACE_isUnconscious", false]) then { - _this playMoveNow "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon"; - } else { - _this playMoveNow "unconscious"; - }; - - [_this, "ACE_Surrendered", false] call ACE_Core_fnc_setCaptivityStatus; - - if (isPlayer _this) then {showHUD true}; - }; } else { - _unit setVariable ["ACE_isSurrender", false, true]; + _unit setVariable ["ACE_isSurrender", false, true]; }; /* player playMove "AmovPercMstpSsurWnonDnon" player switchMove "AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon" -*/ + */ diff --git a/addons/captives/functions/fnc_unloadCaptive.sqf b/addons/captives/functions/fnc_unloadCaptive.sqf index 2ede9de480..057b825d12 100644 --- a/addons/captives/functions/fnc_unloadCaptive.sqf +++ b/addons/captives/functions/fnc_unloadCaptive.sqf @@ -26,7 +26,7 @@ _cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(commo if ((count _cargo) > 0) then { _target = _cargo select 0; - [QGVAR(MoveOut), [_target], [_target]] call EFUNC(common,targetEvent); + ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); } else { ERROR("No captive to unload"); }; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 1eb1c2ef2b..fe4d0528c6 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -20,8 +20,8 @@ PARAMS_2(_target,_vehicle); private ["_cargoIndex"]; -_target moveInCargo _vehicle; -_target assignAsCargo _vehicle; +_target moveInCargo _vehicle; +_target assignAsCargo _vehicle; _cargoIndex = _vehicle getCargoIndex _target; _target setVariable ["ACE_Captives_CargoIndex", _cargoIndex, true];