fix: clear ice data before generating glaciers and icebergs

This commit is contained in:
StempunkDev 2026-01-13 21:28:34 +01:00
parent 23071611d6
commit 5600c06381
2 changed files with 2 additions and 3 deletions

View file

@ -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
}); });
}); });
} }

View file

@ -468,7 +468,6 @@ function editHeightmap(options) {
}); });
// recalculate ice // recalculate ice
Ice.clear();
Ice.generate(); Ice.generate();
drawIce(); drawIce();