mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
FIX: wrong culture migration
This commit is contained in:
parent
6d6df4a8f6
commit
f3d51e677d
1 changed files with 4 additions and 3 deletions
|
|
@ -155,15 +155,16 @@ window.Submap = (function () {
|
||||||
rankCells();
|
rankCells();
|
||||||
|
|
||||||
// transfer basemap cultures
|
// transfer basemap cultures
|
||||||
pack.cultures = baseState.pack.cultures
|
pack.cultures = baseState.pack.cultures;
|
||||||
// fix culture centers
|
// fix culture centers
|
||||||
const validCultures = new Set(pack.cells.culture);
|
const validCultures = new Set(pack.cells.culture);
|
||||||
|
console.log('cultures',validCultures);
|
||||||
pack.cultures.forEach((c, i) => {
|
pack.cultures.forEach((c, i) => {
|
||||||
if (!validCultures.has(c)) {
|
if (!validCultures.has(i)) {
|
||||||
c.removed = true;
|
c.removed = true;
|
||||||
c.center = undefined;
|
c.center = undefined;
|
||||||
} else {
|
} else {
|
||||||
c.center = pack.cells.culture.findIndex(x => x===c);
|
c.center = pack.cells.culture.findIndex(x => x===i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue