Remove duplicates from mags array (#8367)

This commit is contained in:
Serg Vergun 2021-08-23 20:44:06 +03:00 committed by GitHub
parent 2944064c06
commit 0d5a4d89d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,6 +47,7 @@ _mags = _mags apply {
_magParamsArray pushBackUnique _airFriction;
[getText (_magCfg >> _x >> "displayNameShort"), getText (_magCfg >> _x >> "displayName"), _initSpeed, _airFriction]
};
_mags = _mags arrayIntersect _mags;
TRACE_2("",_magParamsArray,_mags);
if ((count _magParamsArray) == 2) then { // test if all magazines share the parameters
_mags = [["", "All Magazines", (_mags select 0) select 2, (_mags select 0) select 3]]; // simplify