From 5d2905ca42619c0529a8cae479f41e5e0a28c5fc Mon Sep 17 00:00:00 2001 From: ulteq Date: Thu, 18 Jun 2015 11:56:58 +0200 Subject: [PATCH] Improved config caching --- addons/hearing/functions/fnc_firedNear.sqf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 04c16f99d4..4164f81b33 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -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;