Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scopes - No Zeroing from Secondary Sights #10220

Merged
merged 15 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix GVAR(Optics) locality issue
mrschick committed Aug 23, 2024
commit 17bea4bee8def6576f77c1ee6b4b9c0c8a03d4f1
6 changes: 5 additions & 1 deletion addons/scopes/functions/fnc_getCurrentZeroRange.sqf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self to clean this up eventually (save CfgWeapons lookup, parentheses)

Original file line number Diff line number Diff line change
@@ -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 {