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

Arsenal - Filter items with scopeArsenal = 0 #5988

Merged
merged 2 commits into from
Dec 29, 2017
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
2 changes: 1 addition & 1 deletion addons/arsenal/functions/fnc_scanConfig.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private _magazineGroups = [[],[]] call CBA_fnc_hashCreate;
(_cargo select 17) pushBackUnique _className;
};
};
} foreach configProperties [_configCfgWeapons, "isClass _x && {getNumber (_x >> 'scope') == 2} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true];
} foreach configProperties [_configCfgWeapons, "isClass _x && {2 == (if (isNumber (_x >> 'scopeArsenal')) then {getNumber (_x >> 'scopeArsenal')} else {getNumber (_x >> 'scope')})} && {getNumber (_x >> 'ace_arsenal_hide') != 1}", true];
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the 2 == in front? That looks so weird.

Copy link
Contributor

Choose a reason for hiding this comment

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

yoda condition 😃

Copy link
Contributor

Choose a reason for hiding this comment

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

I usually use this form, kind short == very_long_expression, it's much easier to see what is checked here.

Copy link
Contributor

@dedmen dedmen Dec 29, 2017

Choose a reason for hiding this comment

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

As I said though this ignores items with scope!=2 and scopeArsenal==2.
Checking both is ofcause a tiny bit slower (lazy eval) but this runs once at gameStart soo..


{
private _className = configName _x;
Expand Down