diff --git a/SQF/dayz_code/compile/fn_clearTurrets.sqf b/SQF/dayz_code/compile/fn_clearTurrets.sqf index 0aa5ff532..a57a53e1b 100644 --- a/SQF/dayz_code/compile/fn_clearTurrets.sqf +++ b/SQF/dayz_code/compile/fn_clearTurrets.sqf @@ -30,7 +30,7 @@ local _findRecurse = { { local _mag = _x; - if !(["horn",_mag] call fnc_inString) then { + if !(["Horn",_mag] call fnc_inString) then { if (DZE_clearVehicleFlares) then { _obj removeMagazinesTurret[_mag,_turret]; } else { diff --git a/SQF/dayz_code/compile/fn_fillTurrets.sqf b/SQF/dayz_code/compile/fn_fillTurrets.sqf index 662399bce..e35ff4469 100644 --- a/SQF/dayz_code/compile/fn_fillTurrets.sqf +++ b/SQF/dayz_code/compile/fn_fillTurrets.sqf @@ -27,21 +27,31 @@ local _findRecurse = { { local _type = _x select 0; - local _turret = _x select 1; - local _mags = getArray(configFile >> "CfgWeapons" >> _type >> "magazines"); - local _mag = _mags select 0; - - if (!isNil "_mag" && {!(["horn",_mag] call fnc_inString)})then { - for "_i" from 1 to _countMags do { - _obj addMagazineTurret[_mag,_turret]; - }; - }; + + 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; + + if (!isNil "_mag")then { + for "_i" from 1 to _countMags do { + _obj addMagazineTurret[_mag,_turret]; + }; + }; + }; } forEach _weaponArray; { - local _mags = getArray(configFile >> "CfgWeapons" >> _x >> "magazines"); - local _mag = _mags select 0; - for "_i" from 1 to _countMags do { - _obj addMagazine _mag; - }; + 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 { + for "_i" from 1 to _countMags do { + _obj addMagazine _mag; + }; + }; + }; } count (weapons _obj); \ No newline at end of file