diff --git a/src/data/mod.tsx b/src/data/mod.tsx index 278624c..ad0600d 100644 --- a/src/data/mod.tsx +++ b/src/data/mod.tsx @@ -46,8 +46,7 @@ export const main = createLayer(() => { style: { filter: "blur(5px)" } - }, - { startNode: c.treeNode, endNode: c.g } + } ], onReset() { points.value = toRaw(this.resettingNode.value) === toRaw(c.treeNode) ? 0 : 10; diff --git a/src/game/persistence.ts b/src/game/persistence.ts index f8d2e80..110e238 100644 --- a/src/game/persistence.ts +++ b/src/game/persistence.ts @@ -48,6 +48,7 @@ export function makePersistent( } globalBus.on("addLayer", (layer: GenericLayer, saveData: Record) => { + const features: { type: typeof Symbol }[] = []; const handleObject = (obj: Record, path: string[] = []): boolean => { let foundPersistent = false; Object.keys(obj).forEach(key => { @@ -76,7 +77,16 @@ globalBus.on("addLayer", (layer: GenericLayer, saveData: Record DefaultValue ]; } - } else if (!(value instanceof Decimal) && !isRef(value)) { + } else if ( + !(value instanceof Decimal) && + !isRef(value) && + // eslint-disable-next-line @typescript-eslint/no-explicit-any + !features.includes(value as { type: typeof Symbol }) + ) { + if (typeof (value as { type: typeof Symbol }).type === "symbol") { + features.push(value as { type: typeof Symbol }); + } + // Continue traversing const foundPersistentInChild = handleObject(value as Record, [ ...path,