Skip to content

Commit

Permalink
Arsenal - Filter non-scope 2 mags from being auto-added (#7445)
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror authored Feb 22, 2020
1 parent f6dda74 commit 1ee2e6a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions addons/arsenal/functions/fnc_onSelChangedLeft.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ switch (GVAR(currentLeftPanel)) do {
call _fnc_clearPreviousWepMags;

private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x};
private _cfgMags = configFile >> "CfgMagazines";
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
GVAR(center) addWeapon _item;
GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]];
if ((count _compatibleMags) > 0) then {
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0]];
};

{
if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then {
Expand Down Expand Up @@ -95,8 +99,12 @@ switch (GVAR(currentLeftPanel)) do {
call _fnc_clearPreviousWepMags;

private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x};
private _cfgMags = configFile >> "CfgMagazines";
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
GVAR(center) addWeapon _item;
GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]];
if ((count _compatibleMags) > 0) then {
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0]];
};

{
if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then {
Expand Down Expand Up @@ -132,8 +140,12 @@ switch (GVAR(currentLeftPanel)) do {
call _fnc_clearPreviousWepMags;

private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x};
private _cfgMags = configFile >> "CfgMagazines";
private _compatibleMags = ([_item, true] call CBA_fnc_compatibleMagazines) select { getNumber (_cfgMags >> _x >> "scope") == 2 };
GVAR(center) addWeapon _item;
GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]];
if ((count _compatibleMags) > 0) then {
GVAR(center) addWeaponItem [_item, [_compatibleMags select 0]];
};

{
if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then {
Expand Down

0 comments on commit 1ee2e6a

Please sign in to comment.