Index: data/mods/public/maps/random/rmgen/placer/centered/DiskPlacer.js =================================================================== --- data/mods/public/maps/random/rmgen/placer/centered/DiskPlacer.js +++ data/mods/public/maps/random/rmgen/placer/centered/DiskPlacer.js @@ -4,6 +4,7 @@ function DiskPlacer(radius, centerPosition = undefined) { this.radiusSquared = Math.square(radius); + this.radius = radius; this.centerPosition = undefined; if (centerPosition) @@ -19,8 +20,13 @@ { let points = []; - for (let x = 0; x < g_Map.getSize(); ++x) - for (let y = 0; y < g_Map.getSize(); ++y) + const xMin = this.centerPosition.x - this.radius; + const xMax = this.centerPosition.x + this.radius; + const yMin = this.centerPosition.y - this.radius; + const yMax = this.centerPosition.y + this.radius; + + for (let x = xMin; x <= xMax; ++x) + for (let y = yMin; y <= yMax; ++y) { let point = new Vector2D(x, y); if (this.centerPosition.distanceToSquared(point) <= this.radiusSquared && constraint.allows(point))