Add validation for actor control targets in scene document

This commit is contained in:
2026-04-14 01:55:10 +02:00
parent 4f1cc67fc3
commit afb2c28714

View File

@@ -2928,6 +2928,30 @@ function validateLightControlTarget(
}
}
function validateActorControlTarget(
target: ActorControlTargetRef,
path: string,
document: SceneDocument,
diagnostics: SceneDiagnostic[]
) {
const matchingActor = Object.values(document.entities).find(
(entity) => entity.kind === "npc" && entity.actorId === target.actorId
);
if (matchingActor !== undefined) {
return;
}
diagnostics.push(
createDiagnostic(
"error",
"missing-control-actor-target",
`Actor control target ${target.actorId} does not exist in this document.`,
`${path}.actorId`
)
);
}
function validateInteractionControlTarget(
target: InteractionControlTargetRef,
path: string,