Enforce boolean validation for collision settings on path elements and update migration for spline corridor collision document version
This commit is contained in:
@@ -6592,6 +6592,7 @@ export function migrateSceneDocument(source: unknown): SceneDocument {
|
|||||||
source.version !== DYNAMIC_TERRAIN_LAYERS_SCENE_DOCUMENT_VERSION &&
|
source.version !== DYNAMIC_TERRAIN_LAYERS_SCENE_DOCUMENT_VERSION &&
|
||||||
source.version !== SPLINE_ROAD_EDGES_SCENE_DOCUMENT_VERSION &&
|
source.version !== SPLINE_ROAD_EDGES_SCENE_DOCUMENT_VERSION &&
|
||||||
source.version !== SPLINE_REPEATERS_SCENE_DOCUMENT_VERSION &&
|
source.version !== SPLINE_REPEATERS_SCENE_DOCUMENT_VERSION &&
|
||||||
|
source.version !== SPLINE_CORRIDOR_COLLISION_SCENE_DOCUMENT_VERSION &&
|
||||||
source.version !== NPC_TARGETING_SCENE_DOCUMENT_VERSION
|
source.version !== NPC_TARGETING_SCENE_DOCUMENT_VERSION
|
||||||
) {
|
) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
@@ -2682,6 +2682,17 @@ function validateScenePathRoadEdge(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isBoolean(edge.collisionEnabled)) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-path-road-edge-collision-enabled",
|
||||||
|
"Path road edge collision enabled must remain a boolean.",
|
||||||
|
`${path}.collisionEnabled`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isScenePathRoadEdgeKind(edge.kind)) {
|
if (!isScenePathRoadEdgeKind(edge.kind)) {
|
||||||
diagnostics.push(
|
diagnostics.push(
|
||||||
createDiagnostic(
|
createDiagnostic(
|
||||||
@@ -2780,6 +2791,17 @@ function validateScenePathRepeater(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isBoolean(repeater.collisionEnabled)) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-path-repeater-collision-enabled",
|
||||||
|
"Path repeater collision enabled must remain a boolean.",
|
||||||
|
`${path}.collisionEnabled`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
typeof repeater.assetId !== "string" ||
|
typeof repeater.assetId !== "string" ||
|
||||||
!isBundledSplineCorridorAssetId(repeater.assetId)
|
!isBundledSplineCorridorAssetId(repeater.assetId)
|
||||||
|
|||||||
Reference in New Issue
Block a user