diff --git a/SQF/dayz_code/compile/fn_fillTurrets.sqf b/SQF/dayz_code/compile/fn_fillTurrets.sqf index e35ff4469..dbdccc3b4 100644 --- a/SQF/dayz_code/compile/fn_fillTurrets.sqf +++ b/SQF/dayz_code/compile/fn_fillTurrets.sqf @@ -30,10 +30,11 @@ local _findRecurse = { if (!(["Horn",_type] call fnc_inString) && (_type != "")) then { local _turret = _x select 1; - local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines"); - local _mag = _mags select 0; + local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines"); - if (!isNil "_mag")then { + if (count _mags > 0) then { + local _mag = _mags select 0; + for "_i" from 1 to _countMags do { _obj addMagazineTurret[_mag,_turret]; }; @@ -45,10 +46,11 @@ local _findRecurse = { local _weapon = _x; if !(["Horn",_weapon] call fnc_inString) then { - local _mags = getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines"); - local _mag = _mags select 0; - - if (!isNil "_mag")then { + local _mags = getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines"); + + if (count _mags > 0) then { + local _mag = _mags select 0; + for "_i" from 1 to _countMags do { _obj addMagazine _mag; };