From 4481741393310beffc201fc19053d15481d85398 Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Sun, 18 Aug 2024 01:00:11 +0200 Subject: [PATCH] Show scope adjustment UI when sighted --- .../functions/fnc_applyScopeAdjustment.sqf | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index b813dde9ef..7f24e0f0b7 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -32,19 +32,17 @@ _adjustment set [_weaponIndex, [_elevation, _windage, _zero]]; playSound selectRandom ["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_Click_3"]; // slightly rotate the player if looking through optic -if (cameraView == "GUNNER") then { - if (!GVAR(simplifiedZeroing)) then { - // Convert adjustmentDifference from mils to degrees - _adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)}; - _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; - private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); - _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; - _pitch = _pitch + _elevationDifference; - _yaw = _yaw + _windageDifference; - [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); - }; -} else { - [] call FUNC(showZeroing); +if (cameraView == "GUNNER" && !GVAR(simplifiedZeroing)) then { + // Convert adjustmentDifference from mils to degrees + _adjustmentDifference = _adjustmentDifference apply {MRAD_TO_DEG(_x)}; + _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; + private _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); + _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; + _pitch = _pitch + _elevationDifference; + _yaw = _yaw + _windageDifference; + [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); }; +[] call FUNC(showZeroing); + true