mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 02:21:24 +01:00
fix: slow load
This commit is contained in:
parent
bc08cd8311
commit
373d6faf31
3 changed files with 19 additions and 19 deletions
|
|
@ -662,28 +662,28 @@ async function parseLoadedData(data, mapVersion) {
|
|||
ERROR && console.error(`[Data integrity] Route ${route.i} has less than 2 points. Removing the route`);
|
||||
Routes.remove(route);
|
||||
}
|
||||
});
|
||||
|
||||
for (const from in pack.cells.routes) {
|
||||
const value = pack.cells.routes[from];
|
||||
if (!value) continue;
|
||||
for (const from in pack.cells.routes) {
|
||||
const value = pack.cells.routes[from];
|
||||
if (!value) continue;
|
||||
|
||||
if (Object.keys(value).length === 0) {
|
||||
// remove empty object
|
||||
delete pack.cells.routes[from];
|
||||
continue;
|
||||
}
|
||||
if (Object.keys(value).length === 0) {
|
||||
// remove empty object
|
||||
delete pack.cells.routes[from];
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const to in value) {
|
||||
const routeId = value[to];
|
||||
const route = pack.routes.find(r => r.i === routeId);
|
||||
if (!route) {
|
||||
ERROR &&
|
||||
console.error(`[Data integrity] Route ${routeId} from ${from} to ${to} is missing. Removing the route`);
|
||||
delete pack.cells.routes[from][to];
|
||||
}
|
||||
for (const to in value) {
|
||||
const routeId = value[to];
|
||||
const route = pack.routes.find(r => r.i === routeId);
|
||||
if (!route) {
|
||||
ERROR &&
|
||||
console.error(`[Data integrity] Route ${routeId} from ${from} to ${to} is missing. Removing the route`);
|
||||
delete pack.cells.routes[from][to];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const markerIds = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue