Update scene document validation for NPC entities

This commit is contained in:
2026-04-15 10:59:16 +02:00
parent 9f0a7fe2af
commit bbf0ae4d70

View File

@@ -3348,13 +3348,14 @@ function validateInteractionLink(
if (
sourceEntity.kind !== "triggerVolume" &&
sourceEntity.kind !== "interactable"
sourceEntity.kind !== "interactable" &&
sourceEntity.kind !== "npc"
) {
diagnostics.push(
createDiagnostic(
"error",
"invalid-interaction-source-kind",
"Interaction links may only source from Trigger Volume or Interactable entities in the current slice.",
"Interaction links may only source from Trigger Volume, Interactable, or NPC entities in the current slice.",
`${path}.sourceEntityId`
)
);
@@ -3382,6 +3383,17 @@ function validateInteractionLink(
)
);
}
} else if (sourceEntity.kind === "npc") {
if (link.trigger !== "click") {
diagnostics.push(
createDiagnostic(
"error",
"unsupported-interaction-trigger",
"NPC links may only use the click trigger.",
`${path}.trigger`
)
);
}
}
switch (link.action.type) {