ACE3/addons/spectator/functions/fnc_canSpectateUnit.sqf

30 lines
753 B
Plaintext
Raw Normal View History

2015-06-29 02:34:21 +00:00
/*
Author:
voiper
Description:
Check if a unit is suitable to spectate.
Arguments:
0: Unit to check <Object>
Example:
[unit] call ace_spectator_canSpectateUnit;
Return Value:
Whether is suitable to spectate <Bool>
Public:
No
*/
#include "script_component.hpp"
_unit = _this select 0;
2015-07-03 18:07:10 +00:00
(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
2015-07-04 23:11:38 +00:00
{!GVAR(limitSide) || (([_unit] call FUNC(unitSide)) == GVAR(cachedSide))} // Only allow units of same side when setting is enabled