2021-10-14 15:46:43 +00:00
#include "script_component.hpp"
/*
* Author: Jonpas
* Checks if camera can be changed.
*
* Arguments:
* 0: New Camera View <STRING>
* 1: Vehicle <OBJECT>
* 2: Check gunner view <BOOL> (default: true)
*
* Return Value:
* Can Change Camera <BOOL>
*
* Example:
* ["INTERNAL", vehicle] call ace_viewrestriction_fnc_canChangeCamera
*
* Public: No
*/
params ["_newCameraView", "_cameraOn", ["_checkGunnerView", true]];
// Remote control hates switchCamera (control returns to player, camera is left on remotely controlled object/unit), make sure remote controlled units are not impacted
!(_newCameraView isEqualTo "GUNNER" && {_checkGunnerView}) &&
2021-12-18 23:15:32 +00:00
{_newCameraView isNotEqualTo "GROUP"} &&
2021-10-14 15:46:43 +00:00
{!isNull ACE_player} &&
{player == ACE_player} &&
{alive ACE_player} &&
{ACE_player == _cameraOn || vehicle ACE_player == _cameraOn} &&
{"" isEqualTo call CBA_fnc_getActiveFeatureCamera} &&
{!(_cameraOn isKindOf "UAV" || _cameraOn isKindOf "UAV_01_base_F")} // UAVs are remote controlled