mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-24 16:17:23 +01:00
Remove comments from zones restoration code
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
This commit is contained in:
parent
fed86420e8
commit
83649e45a9
1 changed files with 0 additions and 5 deletions
|
|
@ -330,10 +330,8 @@ function editHeightmap(options) {
|
|||
c.y = p[1];
|
||||
}
|
||||
|
||||
// recalculate zones to grid - store grid cell IDs in pack.zones
|
||||
for (const zone of pack.zones) {
|
||||
if (!zone.cells || !zone.cells.length) continue;
|
||||
// Convert pack cell IDs to grid cell IDs
|
||||
zone.gridCells = zone.cells.map(i => pack.cells.g[i]);
|
||||
}
|
||||
|
||||
|
|
@ -445,12 +443,9 @@ function editHeightmap(options) {
|
|||
Lakes.defineNames();
|
||||
}
|
||||
|
||||
// restore zones from grid - convert grid cell IDs back to pack cell IDs
|
||||
for (const zone of pack.zones) {
|
||||
if (!zone.gridCells || !zone.gridCells.length) continue;
|
||||
// Find pack cells that correspond to the stored grid cells
|
||||
zone.cells = pack.cells.i.filter(i => zone.gridCells.includes(pack.cells.g[i]));
|
||||
// Clean up temporary storage
|
||||
delete zone.gridCells;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue