Browse Source

Make magazine dynamic again

m3ales 4 years ago
parent
commit
ae19bb6f69

+ 2 - 2
addons - Copy/RD501_Main/functions/reload_on_select/fnc_reloadWeaponOnFirstSelected.sqf

@@ -5,10 +5,10 @@ if(_weapon in RD501_AUTO_RELOAD_ON_EQUIP) then
 	systemChat "Weapon in list";
 	if(count (secondaryWeaponMagazine _unit) == 0) then {
 		systemChat "Weapon in list";
-		_magazineName = "rd501_z1000_x3000_mag";
+		_magazineName = getArray(configFile >> "cfgWeapons" >> currentWeapon _unit >> "magazines") select 0;
 		systemChat format["AutoReloading with %1", _magazineName]; 
 		_unit removeMagazines _magazineName;
-		_unit addMagazine _magazineName; 
+		_unit addMagazine _magazineName;
 		_unit removeSecondaryWeaponItem _magazineName;
 	};
 };