Remove unused heightmap clone

The clone of g_Map.height was only used to read its length, while all
neighbor heights are read from g_Map itself. Cloning the whole heightmap
on every iteration was therefore pure overhead.
This commit is contained in:
Fabio Pedretti authored and Phosit committed 2026-10-10 16:42:53 +02:00
1 parent 6d77c4809d
commit c8cf658d46
1 file changed
+2 -3
@@ -28,10 +28,9 @@ SmoothingPainter.prototype.paint = function(area)
for (let i = 0; i < this.iterations; ++i)
{
const heightmap = clone(g_Map.height);
// Additional complexity to process all 4 vertices of each tile, i.e the last row too
const seen = new Array(heightmap.length).fill(0).map(zero => new Uint8Array(heightmap.length).fill(0));
const vertexSize = g_Map.height.length;
const seen = new Array(vertexSize).fill(0).map(zero => new Uint8Array(vertexSize).fill(0));
for (const point of area.getPoints())
for (const tileVertex of g_TileVertices)