weapon magazines caching

This commit is contained in:
ulteq 2015-06-13 18:57:02 +02:00
parent d9722db15e
commit 6d4f58c18e

View File

@ -48,7 +48,8 @@ if (_silencer != "") then {
_audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire");
}; };
_magazine = ""; _weaponMagazines = missionNamespace getVariable [QEGVAR(common,weaponMagazines), []];
if (count _weaponMagazines == 0) then {
_muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");
_weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
{ {
@ -57,6 +58,10 @@ _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines
_weaponMagazines append _muzzleMagazines; _weaponMagazines append _muzzleMagazines;
}; };
} forEach _muzzles; } forEach _muzzles;
missionNamespace setVariable [QEGVAR(common,weaponMagazines), _weaponMagazines];
};
_magazine = "";
{ {
_ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo");
if (_ammoType == _ammo) exitWith { if (_ammoType == _ammo) exitWith {