Improved config caching

This commit is contained in:
ulteq 2015-06-18 11:56:58 +02:00
parent c3fea42bce
commit 5d2905ca42

View File

@ -58,14 +58,18 @@ if (count _weaponMagazines == 0) then {
_weaponMagazines append _muzzleMagazines;
};
} forEach _muzzles;
{
_ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo");
_weaponMagazines set [_forEachIndex, [_x, _ammoType]];
} forEach _weaponMagazines;
missionNamespace setVariable [format[QEGVAR(common,weaponMagazines_%1),_weapon], _weaponMagazines];
};
_magazine = "";
{
_ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo");
EXPLODE_2_PVT(_x,_magazineType,_ammoType)
if (_ammoType == _ammo) exitWith {
_magazine = _x;
_magazine = _magazineType;
};
} forEach _weaponMagazines;