From e50a28874f90268dabe427b704894757a9fb418f Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Thu, 8 Oct 2015 11:31:29 +0200 Subject: [PATCH] Fix for BI bug, FFV support --- .../nightvision/functions/fnc_handleNVGs.sqf | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/nightvision/functions/fnc_handleNVGs.sqf b/addons/nightvision/functions/fnc_handleNVGs.sqf index 093d3728ac..ca05f5ac94 100644 --- a/addons/nightvision/functions/fnc_handleNVGs.sqf +++ b/addons/nightvision/functions/fnc_handleNVGs.sqf @@ -18,14 +18,17 @@ params ["_unit"]; -if (GVAR(disableNVGsWithSights) && {(vehicle _unit == _unit) || {isTurnedOut _unit}}) then { - if ((cameraView == "GUNNER") && {currentVisionMode _unit > 0}) then { - _unit action ["NVGogglesOff", _unit]; - GVAR(reenableNVGs) = true; - } else { - if (GVAR(reenableNVGs) && {cameraView != "GUNNER"}) then { - _unit action ["NVGoggles", _unit]; - GVAR(reenableNVGs) = false; +if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { + (assignedVehicleRole _unit) params ["_role", "_turretPath"]; + if ((vehicle _unit == _unit) || {isTurnedOut _unit} || {_role == "cargo" && {!(isNil "_turretPath")}}) then { + if ((cameraView == "GUNNER") && {currentVisionMode _unit > 0}) then { + _unit action ["NVGogglesOff", _unit]; + GVAR(reenableNVGs) = true; + } else { + if (GVAR(reenableNVGs) && {cameraView != "GUNNER"}) then { + _unit action ["NVGoggles", _unit]; + GVAR(reenableNVGs) = false; + }; }; }; };