ACE3/addons/spectator/functions/fnc_canSpectateUnit.sqf
2015-07-05 16:44:16 +01:00

23 lines
655 B
Plaintext

/*
* Author: SilentSpike
* Check if a unit is suitable to spectate
*
* Arguments:
* 0: Unit to check <Object>
*
* Return Value:
* Unit is suitable <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
_unit = _this select 0;
(simulationEnabled _unit) && // Simulation enabled
//{!isObjectHidden _unit} && // Not hidden (currently dev branch only)
{!(_unit getVariable [QGVAR(isSpectator), false])} && // Who watches the watchmen?
{(GVAR(AI) || (isPlayer _unit))} && // Only allow AI when setting is enabled
{!GVAR(limitSide) || (([_unit] call FUNC(unitSide)) == GVAR(cachedSide))} // Only allow units of same side when setting is enabled