2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-02-04 19:16:19 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2017-09-22 15:33:08 +00:00
|
|
|
* Tests if player can stop escorting.
|
2015-02-04 19:16:19 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2017-09-22 15:33:08 +00:00
|
|
|
* 0: Caller (player) <OBJECT>
|
|
|
|
* 1: Target <OBJECT> (default: objNull)
|
2015-02-04 19:16:19 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-09-22 15:33:08 +00:00
|
|
|
* Can unit stop escorting another unit <BOOL>
|
2015-02-04 19:16:19 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-02-06 23:03:56 +00:00
|
|
|
* [player, bob] call ACE_captives_fnc_canStopEscorting
|
2015-02-04 19:16:19 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-04 23:15:20 +00:00
|
|
|
params ["_unit", ["_target", objNull]];
|
2015-02-04 19:16:19 +00:00
|
|
|
|
|
|
|
if (isNull _target) then {
|
2015-02-06 05:11:28 +00:00
|
|
|
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
|
2015-02-04 19:16:19 +00:00
|
|
|
};
|
|
|
|
|
2015-02-19 20:34:08 +00:00
|
|
|
if (isNull _target) exitWith {false};
|
2015-02-04 19:16:19 +00:00
|
|
|
|
2015-02-19 20:34:08 +00:00
|
|
|
(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]}
|