Update scene document versions and enhance scene path validation
This commit is contained in:
@@ -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}`)
|
||||
)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user