From 543e829278bdb76f76592dc384e122f609708120 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 31 Aug 2015 14:56:51 +0100 Subject: [PATCH 1/2] 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); From 397d77e5b553db45cf635d5643fe71f192d2713c Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 31 Aug 2015 15:25:40 +0100 Subject: [PATCH 2/2] Remove special goggles treatment of vehicle units The condition to disable the overlay for gunners introduces more problems (and inconsistencies for that matter) than it was worth. Vehicle gunners using camera based weapons should probably consider not wearing a pair of glasses/goggles before doing so. --- addons/goggles/functions/fnc_isGogglesVisible.sqf | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 9f586a9cbf..80f9de4830 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -21,13 +21,8 @@ private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; -if ((vehicle _unit) != _unit) exitWith { - (cameraView != "GUNNER") || - {[_unit] call EFUNC(common,canUseWeapon)} -}; - if (_currentGlasses != "") then { - _position =(getPosASLW _unit); + _position = getPosASLW _unit; if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { _result = ([_currentGlasses] call FUNC(isDivingGoggles)); };