ACE3/addons/switchunits/functions/fnc_isValidAi.sqf

28 lines
484 B
Plaintext
Raw Normal View History

/*
Name: AGM_SwitchUnits_fnc_isValidAi
Author(s):
bux578
Description:
Checks if AI is a valid target for switching
Parameters:
0: OBJECT - unit
Returns:
VOID
*/
2015-01-12 14:47:22 +00:00
#include "script_component.hpp"
private ["_unit"];
_unit = _this select 0;
2015-01-12 14:47:22 +00:00
!([_unit] call EFUNC(Core, 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]})