From f1b1ec0d5532d188c0e5bec8d7b631719e7a9a4c Mon Sep 17 00:00:00 2001 From: jonpas Date: Wed, 14 Aug 2019 17:42:01 +0200 Subject: [PATCH] Fix undefined variable in View Distance --- addons/viewdistance/functions/fnc_changeViewDistance.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 40d07cf100..cb8a07db2d 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -29,9 +29,11 @@ if (_objectViewDistanceCoeff isEqualType 0) then { if (_objectViewDistanceCoeff > 0) then { setObjectViewDistance (_objectViewDistanceCoeff * viewDistance); } else { - // Restore correct view distance when changing from FoV Based to Off - // Restoring directly inside PFH's self-exit resulted in the need of selecting another option to take effect - setObjectViewDistance GVAR(fovBasedPFHminimalViewDistance); + if (!isNil QGVAR(fovBasedPFHminimalViewDistance)) then { + // Restore correct view distance when changing from FoV Based to Off + // Restoring directly inside PFH's self-exit resulted in the need of selecting another option to take effect + setObjectViewDistance GVAR(fovBasedPFHminimalViewDistance); + }; }; } else { if (isNil QGVAR(fovBasedPFHminimalViewDistance)) then {