fix(render): harden portal exit handoff
Some checks failed
CI / linux-portable (push) Successful in 3m19s
CI / windows-gate (push) Failing after 6m43s
CI / release (push) Has been skipped

This commit is contained in:
Erik 2026-08-25 17:39:44 +02:00
parent ddbd7e4096
commit 82e4b4cb6d
17 changed files with 896 additions and 119 deletions

View file

@ -468,7 +468,7 @@ public sealed class LocalPlayerTeleportControllerTests
}
[Fact]
public void ExitSound_ReleasesDestinationBeforeHidingTunnelButKeepsProtocolActive()
public void ExitSound_HidesTunnelBeforeReleasingDestinationAndKeepsProtocolActive()
{
var order = new List<string>();
var harness = new Harness(order: order);
@ -481,6 +481,8 @@ public sealed class LocalPlayerTeleportControllerTests
harness.Controller.Tick(0.016f);
Assert.True(Index(order, "presentation-exit") < Index(order, "reservation-end"));
Assert.True(Index(order, "reservation-end") < Index(order, "exit-cue"));
Assert.False(harness.Presentation.IsPortalViewportVisible);
Assert.True(harness.Controller.IsActive);
Assert.False(harness.Reveal.Snapshot.Completed);
@ -1589,10 +1591,13 @@ public sealed class LocalPlayerTeleportControllerTests
harness.Controller.Tick(0.016f);
Assert.False(harness.Placement.Called);
// Viewport swap: reservation release + exit cue + tunnel retire
// Viewport swap: tunnel retire, reservation release, then exit cue
// (gmSmartBoxUI::UseTime, Sound_UI_ExitPortal @ 0x004D7405).
order.Clear();
harness.Presentation.Enqueue(TeleportAnimEvent.PlayExitSound);
harness.Controller.Tick(0.016f);
Assert.True(Index(order, "presentation-exit") < Index(order, "reservation-end"));
Assert.True(Index(order, "reservation-end") < Index(order, "exit-cue"));
Assert.Equal(["enter", "exit"], harness.Presentation.Cues);
Assert.False(harness.Presentation.IsPortalViewportVisible);
Assert.Single(harness.Streaming.ReservationEnds);
@ -2126,9 +2131,17 @@ public sealed class LocalPlayerTeleportControllerTests
public void TickTunnel(float deltaSeconds) => _order.Add("tunnel-tick");
public readonly List<string> Cues = new();
public void PlayEnterCue() => Cues.Add("enter");
public void PlayExitCue() => Cues.Add("exit");
public void PlayExitCue()
{
Cues.Add("exit");
_order.Add("exit-cue");
}
public void EnterTunnel() => IsPortalViewportVisible = true;
public void ExitTunnel() => IsPortalViewportVisible = false;
public void ExitTunnel()
{
IsPortalViewportVisible = false;
_order.Add("presentation-exit");
}
public void SetWaitCue(bool visible) => WaitCueValues.Add(visible);
public void Reset()