mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
prevent Error Zero divisor here
This commit is contained in:
parent
4420175667
commit
dd54f07534
@ -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)];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -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)];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -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)];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user