From 74ed89f0f9bdb274908facfae4bcb9979d549710 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 09:32:05 +0200 Subject: [PATCH] auto-git: [change] src/runtime-three/runtime-host.ts --- src/runtime-three/runtime-host.ts | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index d51b3427..dfd622ef 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -280,7 +280,7 @@ export interface RuntimeSceneTransitionRequest { } export interface RuntimeDialogueState { - npcEntityId: string; + npcEntityId: string | null; dialogueId: string; title: string; lineId: string; @@ -730,14 +730,22 @@ export class RuntimeHost { return; } - const npc = - this.runtimeScene.entities.npcs.find( - (candidate) => candidate.entityId === this.currentDialogue?.npcEntityId - ) ?? null; const dialogue = - npc?.dialogues.find( - (candidate) => candidate.id === this.currentDialogue?.dialogueId - ) ?? null; + this.currentDialogue.npcEntityId === null + ? this.runtimeScene.dialogues.dialogues[this.currentDialogue.dialogueId] ?? + null + : (() => { + const npc = + this.runtimeScene.entities.npcs.find( + (candidate) => + candidate.entityId === this.currentDialogue?.npcEntityId + ) ?? null; + return ( + npc?.dialogues.find( + (candidate) => candidate.id === this.currentDialogue?.dialogueId + ) ?? null + ); + })(); if (dialogue === null) { this.setRuntimeDialogue(null); @@ -3412,7 +3420,7 @@ export class RuntimeHost { } return { - npcEntityId: source.sourceEntityId ?? "legacy-dialogue-source", + npcEntityId: null, dialogueId, title: dialogue.title, lineId: line.id,