Arsenal - Filter non-scope 2 mags from being auto-added (#7445)

This commit is contained in:
PabstMirror 2020-02-22 15:15:09 -06:00 committed by GitHub
parent f6dda745c2
commit 1ee2e6adb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,8 +57,12 @@ switch (GVAR(currentLeftPanel)) do {
call _fnc_clearPreviousWepMags; call _fnc_clearPreviousWepMags;
private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; 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) 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 { if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then {
@ -95,8 +99,12 @@ switch (GVAR(currentLeftPanel)) do {
call _fnc_clearPreviousWepMags; call _fnc_clearPreviousWepMags;
private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; 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) 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 { if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then {
@ -132,8 +140,12 @@ switch (GVAR(currentLeftPanel)) do {
call _fnc_clearPreviousWepMags; call _fnc_clearPreviousWepMags;
private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; 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) 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 { if (tolower _x in _compatibleItems || {_x in _compatibleMags}) then {