diff --git a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_spawnBoatLoot.sqf b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_spawnBoatLoot.sqf index 82d220bf..9c09808d 100644 --- a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_spawnBoatLoot.sqf +++ b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_spawnBoatLoot.sqf @@ -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; }; }; -}; \ No newline at end of file +};