mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
fix: slow load
This commit is contained in:
parent
18b9f604e9
commit
62805dc1a6
3 changed files with 19 additions and 19 deletions
|
|
@ -652,28 +652,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