From a07cd0e7553233c1bcb2b09cbffa5fb914f718aa Mon Sep 17 00:00:00 2001 From: Marc Emmanuel Date: Fri, 23 Jan 2026 09:21:08 +0100 Subject: [PATCH] fix: bind HeightmapGenerator methods for correct context in editHeightmap --- public/modules/ui/heightmap-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/modules/ui/heightmap-editor.js b/public/modules/ui/heightmap-editor.js index 5c3f1fc3..6e76c4bb 100644 --- a/public/modules/ui/heightmap-editor.js +++ b/public/modules/ui/heightmap-editor.js @@ -675,7 +675,7 @@ function editHeightmap(options) { if (power === 0) return tip("Power should not be zero", false, "error"); const heights = grid.cells.h; - const operation = power > 0 ? HeightmapGenerator.addRange : HeightmapGenerator.addTrough; + const operation = power > 0 ? HeightmapGenerator.addRange.bind(HeightmapGenerator) : HeightmapGenerator.addTrough.bind(HeightmapGenerator); HeightmapGenerator.setGraph(grid); operation("1", String(Math.abs(power)), null, null, fromCell, toCell); const changedHeights = HeightmapGenerator.getHeights();