ACE3/addons/spectator/functions/fnc_getCameraAttributes.sqf
SilentSpike 2a9358ab03 Fix virtual spectator breaking if template active (#5466)
* Simplify virtual spectator code
* Rename camTarget GVAR for linter
* Fix respawn template breaking virtual spectators
2017-08-30 16:36:53 +01:00

31 lines
735 B
Plaintext

/*
* Author: SilentSpike
* Returns the current spectator camera attributes (see setCameraAttributes for details).
*
* Arguments:
* None
*
* Return Value:
* [Mode, Focus, Vision, Position, Direction] <ARRAY>
*
* Example:
* [] call ace_spectator_fnc_getCameraAttributes
*
* Public: Yes
*/
#include "script_component.hpp"
if !(isNil QGVAR(camera)) then {
[GVAR(camMode), GVAR(camFocus), GVAR(camVision), getPosATL GVAR(camera), getDirVisual GVAR(camera)]
} else {
// These values could be pre-set by function
[
GETMVAR(GVAR(camMode),0),
GETMVAR(GVAR(camFocus),objNull),
GETMVAR(GVAR(camVision),-2),
GETMVAR(GVAR(camPos),[ARR_3(0,0,0)]),
GETMVAR(GVAR(camDir),0)
]
};