conform isnil checking: spectator

This commit is contained in:
Whigital 2020-02-11 23:47:18 +01:00
parent a24c3d52ad
commit 275b5edd95
6 changed files with 16 additions and 16 deletions

View File

@ -15,7 +15,7 @@
* Public: Yes
*/
if !(isNil QGVAR(camera)) then {
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

View File

@ -42,13 +42,13 @@ params [
];
// Apply if camera exists
if !(isNil QGVAR(camera)) then {
if (!isNil QGVAR(camera)) then {
// These functions are smart and handle unavailable inputs
if !(isNil "_focus") then {
if (!isNil "_focus") then {
[_focus] call FUNC(setFocus);
};
if !(isNil "_mode") then {
if (!isNil "_mode") then {
// If mode not free and no focus, find focus
if ((_mode != MODE_FREE) && {isNull GVAR(camFocus)}) then {
[true] call FUNC(setFocus);
@ -57,19 +57,19 @@ if !(isNil QGVAR(camera)) then {
[_mode] call FUNC(cam_setCameraMode);
};
if !(isNil "_vision") then {
if (!isNil "_vision") then {
[_vision] call FUNC(cam_setVisionMode);
};
if !(isNil "_position") then {
if (!isNil "_position") then {
GVAR(camera) setPosATL _position;
};
if !(isNil "_direction") then {
if (!isNil "_direction") then {
GVAR(camera) setDir _direction;
};
} else {
if !(isNil "_focus") then {
if (!isNil "_focus") then {
// If there are no entities this becomes nil, handled on camera startup
if (_focus isEqualType true) then {
_focus = ([] call FUNC(getTargetEntities)) select 0;
@ -78,20 +78,20 @@ if !(isNil QGVAR(camera)) then {
GVAR(camFocus) = _focus;
};
if !(isNil "_mode") then {
if (!isNil "_mode") then {
GVAR(camMode) = _mode;
};
if !(isNil "_vision") then {
if (!isNil "_vision") then {
GVAR(camVision) = _vision;
};
// GVARs exits purely for pre-setting of these attributes
if !(isNil "_position") then {
if (!isNil "_position") then {
GVAR(camPos) = ATLtoASL _position;
};
if !(isNil "_direction") then {
if (!isNil "_direction") then {
GVAR(camDir) = _direction;
};
};

View File

@ -33,7 +33,7 @@ while {dialog} do {
BIS_fnc_feedback_allowPP = !_init;
// Removes death blur if present
if !(isNil "BIS_DeathBlur") then {
if (!isNil "BIS_DeathBlur") then {
BIS_DeathBlur ppEffectAdjust [0];
BIS_DeathBlur ppEffectCommit 0;
};

View File

@ -76,7 +76,7 @@ GVAR(uiMapHighlighted) = _nearestEntity;
CTRL_MAP_FOOTER ctrlSetText _text;
// Draw camera icon
if !(isNil QGVAR(camera)) then {
if (!isNil QGVAR(camera)) then {
private _cameraPos = getPosASLVisual GVAR(camera);
private _cameraDir = getDirVisual GVAR(camera);
_map drawIcon [ICON_CAMERA, [0.5, 1, 0.5, 1], _cameraPos, 32, 48, _cameraDir, "", 1, 0.05, "TahomaB", "right"];

View File

@ -45,7 +45,7 @@ if (_newModes isEqualTo []) then {
};
// Update camera in case of change
if !(isNil QGVAR(camera)) then {
if (!isNil QGVAR(camera)) then {
// If mode was free and no longer available, find a focus
if (!(MODE_FREE in _newModes) && {GVAR(camMode) == MODE_FREE} && {isNull GVAR(camFocus)}) then {
[true] call FUNC(setFocus);

View File

@ -53,7 +53,7 @@ if (_newModes isEqualTo []) then {
};
// Update camera in case of change
if !(isNil QGVAR(camera)) then {
if (!isNil QGVAR(camera)) then {
[GVAR(camVision)] call FUNC(cam_setVisionMode);
};