From 543e829278bdb76f76592dc384e122f609708120 Mon Sep 17 00:00:00 2001 From: SilentSpike <silentspike100+Github@gmail.com> Date: Mon, 31 Aug 2015 14:56:51 +0100 Subject: [PATCH] Fix goggles overlay for FFV seats When aiming down sights, view is considered to be "gunner" and so the overlay would be disabled. Introduces addition canUseWeapon check if view is "gunner" to differentiate FFV seats from regular gunner seats --- addons/goggles/functions/fnc_checkGoggles.sqf | 2 +- addons/goggles/functions/fnc_isGogglesVisible.sqf | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf index f222ea9881..84b86c3da4 100644 --- a/addons/goggles/functions/fnc_checkGoggles.sqf +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -18,7 +18,7 @@ if (!alive ace_player) exitWith {}; if (true) then { // Detect if curator interface is open and disable effects - if (!isNull(findDisplay 312)) exitWith { + if !(isNull curatorCamera) exitWith { if (GVAR(EffectsActive)) then { call FUNC(removeGlassesEffect); }; diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 253a82f0a3..9f586a9cbf 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -15,14 +15,16 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; -if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")}; +if ((vehicle _unit) != _unit) exitWith { + (cameraView != "GUNNER") || + {[_unit] call EFUNC(common,canUseWeapon)} +}; if (_currentGlasses != "") then { _position =(getPosASLW _unit);