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,7 +180,7 @@ for "_i" from 1 to _maxStorageLimit do {
|
|||||||
|
|
||||||
if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then {
|
if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then {
|
||||||
_magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count");
|
_magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count");
|
||||||
|
if (_magazineSizeMax >= 1) then {
|
||||||
// Add full magazines cargo
|
// Add full magazines cargo
|
||||||
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
|
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
|
||||||
|
|
||||||
@ -190,6 +190,7 @@ for "_i" from 1 to _maxStorageLimit do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
// Backpack cargo
|
// Backpack cargo
|
||||||
case 2: {
|
case 2: {
|
||||||
if (_x isEqualType "STRING") then {
|
if (_x isEqualType "STRING") then {
|
||||||
|
@ -159,6 +159,7 @@ for "_i" from 1 to _maxVehicleLimit do {
|
|||||||
_magazineSize = _objQty select _forEachIndex;
|
_magazineSize = _objQty select _forEachIndex;
|
||||||
if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then {
|
if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then {
|
||||||
_magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count");
|
_magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count");
|
||||||
|
if (_magazineSizeMax >= 1) then {
|
||||||
// Add full magazines cargo
|
// Add full magazines cargo
|
||||||
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
|
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
|
||||||
// Add last non full magazine
|
// Add last non full magazine
|
||||||
@ -167,6 +168,7 @@ for "_i" from 1 to _maxVehicleLimit do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
// Backpack cargo
|
// Backpack cargo
|
||||||
case 2: {
|
case 2: {
|
||||||
if (_x isEqualType "STRING") then {
|
if (_x isEqualType "STRING") then {
|
||||||
|
@ -183,7 +183,7 @@ for "_i" from 1 to _maxVehicleLimit do {
|
|||||||
|
|
||||||
if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then {
|
if ((_magazineName isEqualType "STRING") && (_magazineSize isEqualType 0)) then {
|
||||||
_magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count");
|
_magazineSizeMax = getNumber (configFile >> "CfgMagazines" >> _magazineName >> "count");
|
||||||
|
if (_magazineSizeMax >= 1) then {
|
||||||
// Add full magazines cargo
|
// Add full magazines cargo
|
||||||
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
|
_vehicle addMagazineAmmoCargo [_magazineName, floor (_magazineSize / _magazineSizeMax), _magazineSizeMax];
|
||||||
|
|
||||||
@ -193,6 +193,7 @@ for "_i" from 1 to _maxVehicleLimit do {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
// Backpack cargo
|
// Backpack cargo
|
||||||
case 2: {
|
case 2: {
|
||||||
if (_x isEqualType "STRING") then {
|
if (_x isEqualType "STRING") then {
|
||||||
|
Loading…
Reference in New Issue
Block a user