Update scene document versions and enhance scene path validation

This commit is contained in:
2026-05-12 22:46:29 +02:00
parent 3da575da72
commit 338b6c2241
2 changed files with 22 additions and 1 deletions

View File

@@ -5678,6 +5678,26 @@ function readScenePathValue(value: unknown, label: string): ScenePath {
visible: expectBoolean(value.visible, `${label}.visible`),
enabled: expectBoolean(value.enabled, `${label}.enabled`),
loop: expectBoolean(value.loop, `${label}.loop`),
curveMode:
value.curveMode === undefined
? DEFAULT_SCENE_PATH_CURVE_MODE
: isScenePathCurveMode(value.curveMode)
? value.curveMode
: expectLiteralString(
value.curveMode,
DEFAULT_SCENE_PATH_CURVE_MODE,
`${label}.curveMode`
),
sampledResolution:
value.sampledResolution === undefined
? DEFAULT_SCENE_PATH_SAMPLED_RESOLUTION
: normalizeScenePathSampledResolution(
readOptionalPositiveInteger(
value.sampledResolution,
`${label}.sampledResolution`,
DEFAULT_SCENE_PATH_SAMPLED_RESOLUTION
)
),
points: value.points.map((pointValue, index) =>
readScenePathPointValue(pointValue, `${label}.points.${index}`)
)

View File

@@ -35,7 +35,8 @@ import {
type FoliagePrototypeRegistry
} from "../foliage/foliage";
export const SCENE_DOCUMENT_VERSION = 99 as const;
export const SCENE_DOCUMENT_VERSION = 100 as const;
export const SPLINE_PATH_SCENE_DOCUMENT_VERSION = 100 as const;
export const NPC_TARGET_ANCHOR_SCENE_DOCUMENT_VERSION = 99 as const;
export const NPC_TARGETING_DEFAULT_SCENE_DOCUMENT_VERSION = 98 as const;
export const NPC_TARGETING_SCENE_DOCUMENT_VERSION = 97 as const;