From 17bea4bee8def6576f77c1ee6b4b9c0c8a03d4f1 Mon Sep 17 00:00:00 2001 From: mrschick <58027418+mrschick@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:15:00 +0200 Subject: [PATCH] Fix GVAR(Optics) locality issue --- addons/scopes/functions/fnc_getCurrentZeroRange.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf index dbcfbaf6d5..9c7e26f654 100644 --- a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf +++ b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf @@ -27,7 +27,11 @@ if (GVAR(simplifiedZeroing)) exitWith { ((_adjustment select _weaponIndex) select 0) }; -private _optic = GVAR(Optics) select _weaponIndex; +private _optic = if (_unit == ACE_Player) then { + GVAR(Optics) select _weaponIndex; +} else { + ([_unit] call FUNC(getOptics)) select _weaponIndex; +}; private _opticConfig = if (_optic != "") then { (configFile >> "CfgWeapons" >> _optic) } else {