ACE3/addons/captives/functions/fnc_canStopEscorting.sqf
PabstMirror a8e269bc18 Cleanup Escort Logic
No more ERROR spam
2015-02-19 14:34:14 -06:00

29 lines
593 B
Plaintext

/*
* Author: PabstMirror
* Tests if player can stop escorting
*
* Arguments:
* 0: caller (player) <OBJECT>
* 1: target <OBJECT><OPTIONAL>
*
* Return Value:
* The return value <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canStopEscorting
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_unit);
DEFAULT_PARAM(1,_target,objNull);
if (isNull _target) then {
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
};
if (isNull _target) exitWith {false};
(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}