mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
exit loop if _shipwrecks array is empty
ref https://github.com/EpochModTeam/Epoch/issues/947
This commit is contained in:
parent
813ee76427
commit
5c3d589443
@ -20,7 +20,8 @@ if (getNumber(_cfgEpoch >> "shipwreckLootEnabled") isEqualTo 1) then {
|
||||
_worldSize = worldSize/2;
|
||||
_shipwrecks = nearestTerrainObjects [ [_worldSize, _worldSize], ["SHIPWRECK"], _worldSize];
|
||||
_total = getNumber(_cfgEpoch >> "maxSpawnedShipwrecks");
|
||||
for "_i" from 0 to _total-1 do{
|
||||
for "_i" from 1 to _total do {
|
||||
if (_shipwrecks isEqualTo []) exitWith {};
|
||||
_wreck = selectRandom _shipwrecks;
|
||||
_shipwrecks = _shipwrecks - [_wreck];
|
||||
_item = createVehicle["container_epoch", _wreck, [], 0, "NONE"];
|
||||
@ -29,4 +30,4 @@ if (getNumber(_cfgEpoch >> "shipwreckLootEnabled") isEqualTo 1) then {
|
||||
_markers = ["Shipwreck",_wreck] call EPOCH_server_createGlobalMarkerSet;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user