mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-02-04 17:41:23 +01:00
fix: clear ice data before generating glaciers and icebergs
This commit is contained in:
parent
23071611d6
commit
5600c06381
2 changed files with 2 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ window.Ice = (function () {
|
||||||
|
|
||||||
// Generate glaciers and icebergs based on temperature and height
|
// Generate glaciers and icebergs based on temperature and height
|
||||||
function generate() {
|
function generate() {
|
||||||
|
clear();
|
||||||
const {cells, features} = grid;
|
const {cells, features} = grid;
|
||||||
const {temp, h} = cells;
|
const {temp, h} = cells;
|
||||||
Math.random = aleaPRNG(seed);
|
Math.random = aleaPRNG(seed);
|
||||||
|
|
@ -31,8 +32,7 @@ window.Ice = (function () {
|
||||||
isolines[type].polygons.forEach(points => {
|
isolines[type].polygons.forEach(points => {
|
||||||
const clipped = clipPoly(points);
|
const clipped = clipPoly(points);
|
||||||
pack.ice.glaciers.push({
|
pack.ice.glaciers.push({
|
||||||
points: clipped,
|
points: clipped
|
||||||
offset: null
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,6 @@ function editHeightmap(options) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// recalculate ice
|
// recalculate ice
|
||||||
Ice.clear();
|
|
||||||
Ice.generate();
|
Ice.generate();
|
||||||
drawIce();
|
drawIce();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue