diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf index a30434f6..4fa7b36f 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_storage.sqf @@ -180,13 +180,14 @@ for "_i" from 1 to _maxStorageLimit do { if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then { _magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count"); + if (_magazineSizeMax >= 1) then { + // Add full magazines cargo + _vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax]; - // Add full magazines cargo - _vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax]; - - // Add last non full magazine - if ((_magazineSize % _magazineSizeMax) > 0) then { - _vehicle addMagazineAmmoCargo [_magazineName, 1, floor (_magazineSize % _magazineSizeMax)]; + // Add last non full magazine + if ((_magazineSize % _magazineSizeMax) > 0) then { + _vehicle addMagazineAmmoCargo [_magazineName, 1, floor (_magazineSize % _magazineSizeMax)]; + }; }; }; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf index 9aba93af..d23544cd 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf @@ -159,11 +159,13 @@ for "_i" from 1 to _maxVehicleLimit do { _magazineSize = _objQty select _forEachIndex; if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then { _magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count"); - // Add full magazines cargo - _vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax]; - // Add last non full magazine - if ((_magazineSize % _magazineSizeMax) > 0) then { - _vehicle addMagazineAmmoCargo [_magazineName, 1, floor (_magazineSize % _magazineSizeMax)]; + if (_magazineSizeMax >= 1) then { + // Add full magazines cargo + _vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax]; + // Add last non full magazine + if ((_magazineSize % _magazineSizeMax) > 0) then { + _vehicle addMagazineAmmoCargo [_magazineName, 1, floor (_magazineSize % _magazineSizeMax)]; + }; }; }; }; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf index 07150427..ff478b27 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles_old.sqf @@ -183,13 +183,14 @@ for "_i" from 1 to _maxVehicleLimit do { if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then { _magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count"); + if (_magazineSizeMax >= 1) then { + // Add full magazines cargo + _vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax]; - // Add full magazines cargo - _vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax]; - - // Add last non full magazine - if ((_magazineSize % _magazineSizeMax) > 0) then { - _vehicle addMagazineAmmoCargo [_magazineName, 1, floor (_magazineSize % _magazineSizeMax)]; + // Add last non full magazine + if ((_magazineSize % _magazineSizeMax) > 0) then { + _vehicle addMagazineAmmoCargo [_magazineName, 1, floor (_magazineSize % _magazineSizeMax)]; + }; }; }; };