mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
fix: bind HeightmapGenerator methods for correct context in editHeightmap
This commit is contained in:
parent
4b341a6590
commit
a07cd0e755
1 changed files with 1 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue