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

Conversation

PabstMirror
Copy link
Contributor

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:

rhs_weap_ak74m_zenitco01_npz [2:0]
rhs_weap_ak74m_zenitco01_npz_grip1 [2:0]
rhs_weap_ak74m_zenitco01_npz_afg [2:0]
rhs_weap_ak105_zenitco01_npz [2:0]
rhs_weap_ak105_zenitco01_npz_grip1 [2:0]
rhs_weap_ak105_zenitco01_npz_afg [2:0]
rhs_weap_ak104_zenitco01_npz [2:0]
rhs_weap_ak104_zenitco01_npz_grip1 [2:0]
rhs_weap_ak104_zenitco01_npz_afg [2:0]
rhs_weap_ak103_zenitco01_npz [2:0]
rhs_weap_ak103_zenitco01_npz_grip1 [2:0]
rhs_weap_ak103_zenitco01_npz_afg [2:0]
rhs_weap_ak74m_dtk [2:0]
rhs_weap_ak105_pgs64 [2:0]
hlc_rifle_G36A1_CMAG [2:0]
hlc_rifle_G36A1AG36_CMAG [2:0]
hlc_rifle_MG36_30rnd [2:0]
hlc_rifle_G36KA1_CMAG [2:0]
hlc_rifle_G36c_CMAG [2:0]
hlc_rifle_G36E1_CMAG [2:0]
hlc_rifle_G36E1AG36_CMAG [2:0]
hlc_rifle_G36E1AG36_Romi_CMAG [2:0]
hlc_rifle_G36KE1_CMAG [2:0]
hlc_rifle_G36V_CMAG [2:0]
hlc_rifle_G36KV_CMAG [2:0]
hlc_rifle_G36cV_CMAG [2:0]
hlc_rifle_G36VAG36_CMAG [2:0]
hlc_rifle_G36KA1KSK_CMAG [2:0]
HLC_Rifle_G36KSKAG36_CMAG [2:0]
hlc_rifle_G36TAC_CMAG [2:0]
hlc_rifle_g36KTac_CMAG [2:0]
hlc_rifle_G36CTac_CMAG [2:0]
hlc_rifle_g3sg1_XMAG [2:0]
hlc_rifle_g3sg1ris_XMAG [2:0]
hlc_rifle_psg1_XMAG [2:0]
hlc_rifle_psg1A1_XMAG [2:0]
hlc_rifle_PSG1A1_RIS_XMAG [2:0]
hlc_rifle_g3a3_XMAG [2:0]
hlc_rifle_g3a3ris_XMAG [2:0]
hlc_rifle_g3a3v_XMAG [2:0]
hlc_rifle_g3a3vris_XMAG [2:0]
hlc_rifle_g3ka4_XMAG [2:0]
HLC_Rifle_g3ka4_GL_XMAG [2:0]
hlc_rifle_hk51_XMAG [2:0]
ACE_key_master [2:0]
ACE_key_lockpick [2:0]
ACE_key_west [2:0]
ACE_key_east [2:0]
ACE_key_indp [2:0]
ACE_key_civ [2:0]
CUP_U_B_GER_Ghillie [2:0]
CUP_U_B_GER_Fleck_Ghillie [2:0]
CUP_H_SLA_Pilot_Helmet [2:0]
CUP_U_O_TK_Ghillie [2:0]
CUP_U_B_USArmy_Ghillie [2:0]
CUP_U_B_USMC_Ghillie_WDL [2:0]
CUP_U_B_BAF_MTP_Ghillie [2:0]

@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Dec 29, 2017
@PabstMirror PabstMirror added this to the 3.13.0 milestone Dec 29, 2017
@jonpas
Copy link
Member

jonpas commented Dec 29, 2017

@alganthe

@@ -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..

@alganthe
Copy link
Contributor

Go for it :/

Copy link
Member

@kymckay kymckay left a 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.

@PabstMirror PabstMirror merged commit 65fe101 into master Dec 29, 2017
@PabstMirror PabstMirror deleted the arsenal-filterScope branch December 29, 2017 18:39
@PabstMirror PabstMirror modified the milestones: 3.13.0, 3.12.1 Dec 31, 2017
@alganthe alganthe mentioned this pull request Jan 24, 2018
BaerMitUmlaut pushed a commit that referenced this pull request Aug 5, 2019
* Arsenal - Filter items with scopeArsenal = 0

* change order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants