2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
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:
|
2015-08-07 07:18:42 +00:00
|
|
|
* Valid AI <BOOL>
|
2015-02-02 22:28:27 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-07 07:18:42 +00:00
|
|
|
* [_unit] call ace_switchunits_fnc_isValidAi
|
2015-02-02 22:28:27 +00:00
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-01-12 14:47:22 +00:00
|
|
|
|
2015-08-07 07:18:42 +00:00
|
|
|
params ["_unit"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-13 05:14:27 +00:00
|
|
|
!([_unit] call EFUNC(common,isPlayer)
|
2015-01-11 16:42:31 +00:00
|
|
|
|| {_unit in playableUnits}
|
2015-08-07 07:18:42 +00:00
|
|
|
|| {vehicle _unit != _unit}
|
|
|
|
|| {_unit getVariable [QGVAR(IsPlayerUnit), false]}
|
|
|
|
|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return
|