Skip to content

Commit 79d0aa3

Browse files
committed
Merge branch 'master' into unusedBase
2 parents b101159 + eb6f8e8 commit 79d0aa3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

addons/nightvision/functions/fnc_onVisionModeChanged.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ if (GVAR(effectScaling) == 0) exitWith {
3939

4040
// Start PFEH when entering night vision mode:
4141
if (_visionMode > 0) then {
42+
[true] call FUNC(setupDisplayEffects); // always reset effects (switching from NVG to Thermal)
4243
if (GVAR(PFID) == -1) then {
4344
GVAR(running) = true;
44-
[true] call FUNC(setupDisplayEffects);
4545
[] call FUNC(refreshGoggleType);
4646
GVAR(PFID) = [LINKFUNC(pfeh), 0, []] call CBA_fnc_addPerFrameHandler;
4747
GVAR(firedEHs) = [

addons/nightvision/functions/fnc_pfeh.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ if (GVAR(defaultPositionBorder) isNotEqualTo []) then {
5757
};
5858
END_COUNTER(borderScaling);
5959

60+
// Skip all other effects if just in thermal
61+
if (currentVisionMode _unit > 1) exitWith {};
62+
6063
if (IS_MAGNIFIED isNotEqualTo GVAR(isUsingMagnification)) then {
6164
GVAR(isUsingMagnification) = IS_MAGNIFIED;
6265
GVAR(nextEffectsUpdate) = -1;

addons/nightvision/functions/fnc_setupDisplayEffects.sqf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if (GVAR(fogScaling) > 0) then {
4848
0 setFog GVAR(priorFog);
4949
GVAR(priorFog) = nil;
5050
} else {
51+
if (currentVisionMode _unit > 1) exitWith {}; // Don't error if switching directly to thermal
5152
ERROR("no fog backed up");
5253
};
5354

0 commit comments

Comments
 (0)