mirror of
https://github.com/acemod/ACE3.git
synced 2025-07-25 04:42:48 +00:00
Replace one more macro
This commit is contained in:
@ -35,7 +35,9 @@ if (_state) then {
|
|||||||
nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))];
|
nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))];
|
||||||
|
|
||||||
[{
|
[{
|
||||||
EXPLODE_3_PVT((_this select 0),_unit,_target,_actionID);
|
params ["_args", "_pfID"];
|
||||||
|
_args params ["_unit", "_target", "_actionID"];
|
||||||
|
|
||||||
if (_unit getVariable [QGVAR(isEscorting), false]) then {
|
if (_unit getVariable [QGVAR(isEscorting), false]) then {
|
||||||
if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then {
|
if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then {
|
||||||
_unit setVariable [QGVAR(isEscorting), false, true];
|
_unit setVariable [QGVAR(isEscorting), false, true];
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_unit","_state"];
|
params ["_unit","_state"];
|
||||||
|
TRACE_2("params",_unit,_state);
|
||||||
|
|
||||||
if (!local _unit) exitwith {
|
if (!local _unit) exitwith {
|
||||||
ERROR("running setHandcuffed on remote unit");
|
ERROR("running setHandcuffed on remote unit");
|
||||||
@ -56,7 +57,7 @@ if (_state) then {
|
|||||||
//Adds an animation changed eh
|
//Adds an animation changed eh
|
||||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||||
private "_animChangedEHID";
|
private "_animChangedEHID";
|
||||||
TRACE_1("Adding animChangedEH",_unit);
|
|
||||||
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
_animChangedEHID = _unit addEventHandler ["AnimChanged", {
|
||||||
params ["_unit", "_newAnimation"];
|
params ["_unit", "_newAnimation"];
|
||||||
TRACE_2("AnimChanged",_unit,_newAnimation);
|
TRACE_2("AnimChanged",_unit,_newAnimation);
|
||||||
@ -80,6 +81,7 @@ if (_state) then {
|
|||||||
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
|
[_unit, "ACE_HandcuffedFFV", 1] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
}];
|
}];
|
||||||
|
TRACE_2("Adding animChangedEH",_unit,_animChangedEHID);
|
||||||
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
|
_unit setVariable [QGVAR(handcuffAnimEHID), _animChangedEHID];
|
||||||
|
|
||||||
}, [_unit], 0.01] call EFUNC(common,waitAndExecute);
|
}, [_unit], 0.01] call EFUNC(common,waitAndExecute);
|
||||||
@ -90,6 +92,7 @@ if (_state) then {
|
|||||||
//remove AnimChanged EH
|
//remove AnimChanged EH
|
||||||
private "_animChangedEHID";
|
private "_animChangedEHID";
|
||||||
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
_animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||||
|
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||||
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
|
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user