alternative grid generators

This commit is contained in:
GoteGuru 2022-06-08 01:10:13 +02:00
parent 8735ca8a3e
commit 3827a50bee
3 changed files with 70 additions and 8 deletions

View file

@ -642,8 +642,10 @@ async function generate(options) {
applyMapSize();
randomizeOptions();
const method = window[document.getElementById('gridAlgorithm').value];
console.log('gird generation method', method);
if (shouldRegenerateGrid(grid)) grid = precreatedGraph || generateGrid();
if (shouldRegenerateGrid(grid, method)) grid = precreatedGraph || generateGrid(method);
else delete grid.cells.h;
grid.cells.h = await HeightmapGenerator.generate(grid);