From 5600c063816a1451bbc99374a5da3502d2d2100a Mon Sep 17 00:00:00 2001 From: StempunkDev Date: Tue, 13 Jan 2026 21:28:34 +0100 Subject: [PATCH] fix: clear ice data before generating glaciers and icebergs --- public/modules/ice.js | 4 ++-- public/modules/ui/heightmap-editor.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/modules/ice.js b/public/modules/ice.js index d1127825..8dbbeeb3 100644 --- a/public/modules/ice.js +++ b/public/modules/ice.js @@ -12,6 +12,7 @@ window.Ice = (function () { // Generate glaciers and icebergs based on temperature and height function generate() { + clear(); const {cells, features} = grid; const {temp, h} = cells; Math.random = aleaPRNG(seed); @@ -31,8 +32,7 @@ window.Ice = (function () { isolines[type].polygons.forEach(points => { const clipped = clipPoly(points); pack.ice.glaciers.push({ - points: clipped, - offset: null + points: clipped }); }); } diff --git a/public/modules/ui/heightmap-editor.js b/public/modules/ui/heightmap-editor.js index 3c3d0a6e..6fe69b78 100644 --- a/public/modules/ui/heightmap-editor.js +++ b/public/modules/ui/heightmap-editor.js @@ -468,7 +468,6 @@ function editHeightmap(options) { }); // recalculate ice - Ice.clear(); Ice.generate(); drawIce();