ACE3/addons/captives/functions/fnc_canEscortCaptive.sqf
johnb432 ee0e947611
General - Use ace_common_fnc_isAwake where possible (#10098)
* Use `ace_common_fnc_isAwake` where possible

* Revert bad change
2024-07-02 12:38:14 -07:00

27 lines
584 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror
* Tests if can escort target (attach)
*
* Arguments:
* 0: Caller (player) <OBJECT>
* 1: Target <OBJECT>
*
* Return Value:
* Can escort <BOOL>
*
* Example:
* [player, bob] call ACE_captives_fnc_canEscortCaptive
*
* Public: No
*/
params ["_unit", "_target"];
// Alive, handcuffed, not being escorted, and not unconscious
(_target getVariable [QGVAR(isHandcuffed), false]) &&
{isNull (attachedTo _target)} &&
{_target call EFUNC(common,isAwake)} &&
{(vehicle _unit) == _unit} &&
{(vehicle _target) == _target}