From 00ef47ed598901a72b706503cefc84d972704ffb Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 21 Jun 2026 20:07:50 +0200 Subject: [PATCH] =?UTF-8?q?refactor(teleport):=20Slice=201=20review=20clea?= =?UTF-8?q?nup=20=E2=80=94=20drop=20vestigial=20pending=20fields;=20commen?= =?UTF-8?q?t=20the=20worldReady=20min-continue=20gate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code-review follow-up: the exit-sound/login-complete events are emitted inline at their transitions, so the _exitSoundPending/_loginCompletePending fields were set-then-cleared dead code — removed. Added a comment explaining why TunnelContinue's min-advance is gated on worldReady. No behavior change; 29/29 sequencer tests still green. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../World/TeleportAnimSequencer.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/AcDream.Core/World/TeleportAnimSequencer.cs b/src/AcDream.Core/World/TeleportAnimSequencer.cs index c786ea13..4280ea73 100644 --- a/src/AcDream.Core/World/TeleportAnimSequencer.cs +++ b/src/AcDream.Core/World/TeleportAnimSequencer.cs @@ -55,8 +55,6 @@ public sealed class TeleportAnimSequencer private float _continueElapsed = 0f; // tracks time inside TunnelContinue private bool _enterSoundPending = false; private bool _enterTunnelPending = false; - private bool _exitSoundPending = false; - private bool _loginCompletePending = false; public bool IsActive => _state != TeleportAnimState.Off; public TeleportAnimState State => _state; @@ -74,8 +72,6 @@ public sealed class TeleportAnimSequencer _continueElapsed = 0f; _enterSoundPending = true; _enterTunnelPending = _state == TeleportAnimState.Tunnel; // true for Portal/Login/Death - _exitSoundPending = false; - _loginCompletePending = false; } /// @@ -88,11 +84,10 @@ public sealed class TeleportAnimSequencer { var evts = new List(); - // Edge events queued by Begin or a prior transition: - if (_enterSoundPending) { evts.Add(TeleportAnimEvent.PlayEnterSound); _enterSoundPending = false; } - if (_enterTunnelPending) { evts.Add(TeleportAnimEvent.EnterTunnel); _enterTunnelPending = false; } - if (_exitSoundPending) { evts.Add(TeleportAnimEvent.PlayExitSound); _exitSoundPending = false; } - if (_loginCompletePending) { evts.Add(TeleportAnimEvent.FireLoginComplete); _loginCompletePending = false; } + // Edge events queued by Begin or a prior transition (enter-sound + enter-tunnel only; + // exit-sound and login-complete are emitted inline at their transitions below): + if (_enterSoundPending) { evts.Add(TeleportAnimEvent.PlayEnterSound); _enterSoundPending = false; } + if (_enterTunnelPending) { evts.Add(TeleportAnimEvent.EnterTunnel); _enterTunnelPending = false; } _elapsed += dt; @@ -121,6 +116,9 @@ public sealed class TeleportAnimSequencer case TeleportAnimState.TunnelContinue: _continueElapsed += dt; + // worldReady stays true once the landblock loads, so this advances at the 2s + // minimum in the normal case; gating min-advance on worldReady keeps the + // MaxContinue safety net authoritative if readiness ever regresses mid-continue. bool minMet = worldReady && _continueElapsed >= MinContinue; bool maxForce = _continueElapsed >= MaxContinue; if (minMet || maxForce) @@ -131,9 +129,7 @@ public sealed class TeleportAnimSequencer if (_elapsed >= FadeTime) { Advance(TeleportAnimState.WorldFadeIn, enterTunnel: false); - // Flush exit sound in the same tick: evts.Add(TeleportAnimEvent.PlayExitSound); - _exitSoundPending = false; } break; @@ -142,7 +138,6 @@ public sealed class TeleportAnimSequencer { Advance(TeleportAnimState.Off, enterTunnel: false); evts.Add(TeleportAnimEvent.FireLoginComplete); - _loginCompletePending = false; } break;