From dc60860421984110169173fd20eddb724e51e94b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 26 Dec 2015 23:31:49 -0600 Subject: [PATCH] Fix Third Person Goggle Effect Not Displaying #3074 --- addons/goggles/XEH_postInit.sqf | 10 +++++++--- addons/goggles/functions/fnc_applyDirtEffect.sqf | 1 - addons/goggles/functions/fnc_applyDustEffect.sqf | 1 - addons/goggles/functions/fnc_externalCamera.sqf | 6 +++++- addons/goggles/functions/fnc_handleExplosion.sqf | 1 - 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 09a84ad151..a4872f6a3f 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -114,16 +114,20 @@ private _fnc_checkGoggles = { // goggles effects main PFH [{ + BEGIN_COUNTER(goggles); + // rain call FUNC(applyRainEffect); // auto remove effects under water - if (GVAR(EffectsActive) && {[goggles ACE_player] call FUNC(isDivingGoggles) && {underwater ACE_player}}) then { + if (GVAR(EffectsActive) && {underwater ACE_player} && {[goggles ACE_player] call FUNC(isDivingGoggles)}) then { call FUNC(removeRainEffect); call FUNC(removeDirtEffect); call FUNC(removeDustEffect); }; // rotor wash effect - call FUNC(applyRotorWashEffect) -}, 0.5, _fnc_checkGoggles] call CBA_fnc_addPerFrameHandler; + call FUNC(applyRotorWashEffect); + + END_COUNTER(goggles); +}, 0.5, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index c7ff386f9d..4b5ee13a0f 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -if (GVAR(showInThirdPerson)) exitWith {false}; if (call FUNC(externalCamera)) exitWith {false}; private ["_unit", "_effects"]; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 75f4853c01..944b98f127 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -if (GVAR(showInThirdPerson)) exitWith {}; if (call FUNC(ExternalCamera)) exitWith {}; private ["_unit", "_amount"]; diff --git a/addons/goggles/functions/fnc_externalCamera.sqf b/addons/goggles/functions/fnc_externalCamera.sqf index 1af09827ab..85776fb0d6 100644 --- a/addons/goggles/functions/fnc_externalCamera.sqf +++ b/addons/goggles/functions/fnc_externalCamera.sqf @@ -15,4 +15,8 @@ */ #include "script_component.hpp" -cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return +if (GVAR(showInThirdPerson)) then { + cameraView in ["GROUP"] || EFUNC(common,isFeatureCameraActive) +} else { + cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) +}; diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index 795cdd78b1..b5c71a3d94 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -37,7 +37,6 @@ _effects set [BROKEN, true]; SETGLASSES(_unit,_effects); if (getText (_config >> "ACE_OverlayCracked") != "") then { - if (GVAR(showInThirdPerson)) exitWith {}; if (call FUNC(ExternalCamera)) exitWith {}; if (isNull (GLASSDISPLAY)) then {