ACE3/addons/switchunits/functions/fnc_isValidAi.sqf

28 lines
491 B
Plaintext
Raw Normal View History

/*
2015-02-02 22:28:27 +00:00
* Author: bux578
* Checks if AI is a valid target for switching.
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
* Boolean
*
* Example:
* [_unit] call FUNC(isValidAi)
*
* Public: Yes
*/
2015-01-12 14:47:22 +00:00
#include "script_component.hpp"
2015-02-02 22:28:27 +00:00
private "_unit";
_unit = _this select 0;
2015-01-13 05:14:27 +00:00
!([_unit] call EFUNC(common,isPlayer)
|| {_unit in playableUnits}
|| {vehicle _unit != _unit}
2015-01-12 14:47:22 +00:00
|| {_unit getVariable [QGVAR(IsPlayerUnit), false]}
|| {_unit getVariable [QGVAR(IsPlayerControlled), false]})