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(Guns) locality issue
mrschick committed Aug 23, 2024
commit 34e7a70fdf30016951a034ea263be412c284f1a2
11 changes: 10 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
@@ -35,7 +35,16 @@ private _optic = if (_unit == ACE_Player) then {
private _opticConfig = if (_optic != "") then {
(configFile >> "CfgWeapons" >> _optic)
} else {
(configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex))
if (_unit == ACE_Player) then {
(configFile >> "CfgWeapons" >> (GVAR(Guns) select _weaponIndex))
} else {
private _gun = switch (_weaponIndex) do {
case 1: { secondaryWeapon _unit };
case 2: { handgunWeapon _unit };
default { primaryWeapon _unit };
};
(configFile >> "CfgWeapons" >> _gun)
};
};

private _zeroRange = currentZeroing _unit;