Skip to content

fix: grabbing a bed again during its sleep dialog no longer breaks every later dialog - #561

Open
BoroBongo wants to merge 1 commit into
developfrom
fix/mob-dialog-regrab
Open

BoroBongo wants to merge 1 commit into
developfrom
fix/mob-dialog-regrab

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

Grabbing a bed (or any mob) again while its dialog is open no longer breaks every later dialog.

  • A mob dialog (the bed's sleep choices, SLEEPABIT_S1) hangs the dialog box on a dialog anchor next to the mob. A second grab started a new mob dialog. In VR a grab fires repeatedly, so this happened after 1.2 s in the playtest. PrepareMobDialog destroyed the old anchor, and the open dialog box with its option items went with it.
  • From then on every dialog threw NullReferenceException in VRDialog.ClearDialogOptions: when loading a game, and at the next NPC (G2 Bartok turned to the hero and held him, but showed no choices and said nothing).
  • Now, like the engine, no mob is used while a dialog is open or the hero's queue is about to open one (DialogService.IsBusy, checked in MobInteractionService.HandleMobGrab).
  • As a fallback, PrepareMobDialog closes an open dialog before it drops the old anchor.
  • Loading a game resets the hero queue flag: its coroutine dies with the scene without its finally, and the flag would have blocked every mob.

Why

Playtest log (G2, PC build): [MobDialog] Hero action StartProcessInfos failed: Object reference not set on every grab of the bed after the first one, then StartProcessInfos of Bartok (440) threw with the stack in VRDialog.ClearDialogOptions.

How to test manually

  • G2, Khorinis at night: grab a bed (also one with a sleeping NPC) and keep grabbing it a few times. The sleep choices stay, and "END" closes them.
  • Grab the bed again after closing: the choices come back.
  • Then talk to an NPC (e.g. Bartok at the harbor): the choices show and he talks.
  • Load a save while the bed's choices are open, then talk to an NPC: dialogs work.
  • G1: a bed or a mob with a dialog (e.g. an alchemy table) behaves the same.

Tested in the editor: two grabs of a bed in a row, the second is ignored, the options stay intact, "END" closes them and the next grab opens them again. Not tested in a build or with a headset yet, and nothing on Quest 2 or Quest 3 standalone.

Save/load

Nothing saved. Loading during a mob dialog now closes it cleanly.

Known gaps / follow-ups

  • If a dialog fails in some other way, IsInDialog can stay true and mobs stay blocked until the next dialog ends. Not seen, but possible.

…ery later dialog (NPCs turned to the hero but said nothing)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant