Index: binaries/data/mods/public/maps/random/rmgen/library.js =================================================================== --- binaries/data/mods/public/maps/random/rmgen/library.js +++ binaries/data/mods/public/maps/random/rmgen/library.js @@ -153,6 +153,9 @@ */ function createAreasInAreas(centeredPlacer, painter, constraints, amount, retryFactor, areas) { + if (!areas.length) + return []; + let placeFunc = function() { centeredPlacer.setCenterPosition(pickRandom(pickRandom(areas).getPoints())); return createArea(centeredPlacer, painter, constraints); @@ -181,6 +184,9 @@ */ function createObjectGroupsByAreas(group, player, constraints, amount, retryFactor, areas, behaveDeprecated = false) { + if (!areas.length) + return []; + let placeFunc = function() { group.setCenterPosition(pickRandom(pickRandom(areas).getPoints())); return createObjectGroup(group, player, constraints);