mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-22 08:31:31 +00:00
Fixed error when switching between saves with different layers
This commit is contained in:
parent
2d9de00424
commit
9a40249c00
1 changed files with 4 additions and 2 deletions
|
@ -102,8 +102,10 @@ export async function loadSave(playerObj: Partial<PlayerData>): Promise<void> {
|
|||
const { fixOldSave, getInitialLayers } = await import("data/projEntry");
|
||||
|
||||
for (const layer in layers) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
removeLayer(layers[layer]!);
|
||||
const l = layers[layer];
|
||||
if (l) {
|
||||
removeLayer(l);
|
||||
}
|
||||
}
|
||||
getInitialLayers(playerObj).forEach(layer => addLayer(layer, playerObj));
|
||||
|
||||
|
|
Loading…
Reference in a new issue