Changed case output to match config

This commit is contained in:
lambdatiger 2024-01-19 13:32:22 -06:00
parent 40b9cd3c41
commit 2e6186c09b

View File

@ -40,25 +40,27 @@ if (_onlyShotAmmoTypes) then {
]; ];
if (_ammo isEqualTo "" || {_ammo in _allAmmoConfigs}) exitWith {}; if (_ammo isEqualTo "" || {_ammo in _allAmmoConfigs}) exitWith {};
_allAmmoConfigs pushBack _ammo; _allAmmoConfigs pushBack _ammo;
private _submunitionConfig = configFile >> "CfgAmmo" >> _ammo >> "submunitionAmmo"; private _cfgAmmoRoot = configFile >> "CfgAmmo";
private _submunitionConfig = _cfgAmmoRoot >> _ammo >> "submunitionAmmo";
if (isArray _submunitionConfig) then { if (isArray _submunitionConfig) then {
private _subMunition = getArray _submunitionConfig; private _subMunition = getArray _submunitionConfig;
for "_i" from 0 to count _subMunition - 1 do { for "_i" from 0 to count _subMunition - 1 do {
if (_i mod 2 == 0) then { if (_i mod 2 == 0) then {
[toLowerANSI (_subMunition#_i)] call _configSearchFunc; [configName (_cfgAmmoRoot >> (_subMunition#_i))] call _configSearchFunc;
}; };
}; };
} else { } else {
private _subMunition = getText _submunitionConfig; private _subMunition = getText _submunitionConfig;
if (_subMunition isNotEqualTo "") then { if (_subMunition isNotEqualTo "") then {
[toLowerANSI _subMunition] call _configSearchFunc; [configName (_cfgAmmoRoot >> _subMunition)] call _configSearchFunc;
}; };
}; };
}; };
private _allMagazineConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true]; private _allMagazineConfigs = configProperties [configFile >> "CfgMagazines", "isClass _x", true];
private _cfgAmmoCfgPath = configFile >> "CfgAmmo";
{ {
[toLowerANSI getText (_x >> "ammo")] call _configSearchFunc; private _magAmmo = getText (_x >> "ammo");
[configName (_cfgAmmoCfgPath >> _magAmmo)] call _configSearchFunc;
} forEach _allMagazineConfigs; } forEach _allMagazineConfigs;
} else { } else {
_allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true] apply {configName _x}; _allAmmoConfigs = configProperties [configFile >> "CfgAmmo", "isClass _x && !('ace_frag' in configName _x)", true] apply {configName _x};