prevent Error Zero divisor here

This commit is contained in:
vbawol 2016-07-13 07:51:43 -05:00
parent 4420175667
commit dd54f07534
3 changed files with 21 additions and 17 deletions

View File

@ -180,7 +180,7 @@ 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];
@ -190,6 +190,7 @@ for "_i" from 1 to _maxStorageLimit do {
};
};
};
};
// Backpack cargo
case 2: {
if (_x isEqualType "STRING") then {

View File

@ -159,6 +159,7 @@ 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");
if (_magazineSizeMax >= 1) then {
// Add full magazines cargo
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
// Add last non full magazine
@ -167,6 +168,7 @@ for "_i" from 1 to _maxVehicleLimit do {
};
};
};
};
// Backpack cargo
case 2: {
if (_x isEqualType "STRING") then {

View File

@ -183,7 +183,7 @@ 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];
@ -193,6 +193,7 @@ for "_i" from 1 to _maxVehicleLimit do {
};
};
};
};
// Backpack cargo
case 2: {
if (_x isEqualType "STRING") then {