-
Notifications
You must be signed in to change notification settings - Fork 737
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
Conversation
@@ -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]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yoda condition 😃
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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..
Go for it :/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runs once upon game launch so performance impact is negligible; consistency with vanilla arsenal is desired.
* Arsenal - Filter items with scopeArsenal = 0 * change order
Fix #5983
Uses same logic as bis's arsenal
_scope = if (isnumber (_class >> "scopeArsenal")) then {getnumber (_class >> "scopeArsenal")} else {getnumber (_class >> "scope")};
What gets filtered with my modset: