refactor(teleport): Slice 1 review cleanup — drop vestigial pending fields; comment the worldReady min-continue gate

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) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-21 20:07:50 +02:00
parent 2c8cd887e5
commit 00ef47ed59

View file

@ -55,8 +55,6 @@ public sealed class TeleportAnimSequencer
private float _continueElapsed = 0f; // tracks time inside TunnelContinue private float _continueElapsed = 0f; // tracks time inside TunnelContinue
private bool _enterSoundPending = false; private bool _enterSoundPending = false;
private bool _enterTunnelPending = false; private bool _enterTunnelPending = false;
private bool _exitSoundPending = false;
private bool _loginCompletePending = false;
public bool IsActive => _state != TeleportAnimState.Off; public bool IsActive => _state != TeleportAnimState.Off;
public TeleportAnimState State => _state; public TeleportAnimState State => _state;
@ -74,8 +72,6 @@ public sealed class TeleportAnimSequencer
_continueElapsed = 0f; _continueElapsed = 0f;
_enterSoundPending = true; _enterSoundPending = true;
_enterTunnelPending = _state == TeleportAnimState.Tunnel; // true for Portal/Login/Death _enterTunnelPending = _state == TeleportAnimState.Tunnel; // true for Portal/Login/Death
_exitSoundPending = false;
_loginCompletePending = false;
} }
/// <summary> /// <summary>
@ -88,11 +84,10 @@ public sealed class TeleportAnimSequencer
{ {
var evts = new List<TeleportAnimEvent>(); var evts = new List<TeleportAnimEvent>();
// Edge events queued by Begin or a prior transition: // Edge events queued by Begin or a prior transition (enter-sound + enter-tunnel only;
if (_enterSoundPending) { evts.Add(TeleportAnimEvent.PlayEnterSound); _enterSoundPending = false; } // exit-sound and login-complete are emitted inline at their transitions below):
if (_enterTunnelPending) { evts.Add(TeleportAnimEvent.EnterTunnel); _enterTunnelPending = false; } if (_enterSoundPending) { evts.Add(TeleportAnimEvent.PlayEnterSound); _enterSoundPending = false; }
if (_exitSoundPending) { evts.Add(TeleportAnimEvent.PlayExitSound); _exitSoundPending = false; } if (_enterTunnelPending) { evts.Add(TeleportAnimEvent.EnterTunnel); _enterTunnelPending = false; }
if (_loginCompletePending) { evts.Add(TeleportAnimEvent.FireLoginComplete); _loginCompletePending = false; }
_elapsed += dt; _elapsed += dt;
@ -121,6 +116,9 @@ public sealed class TeleportAnimSequencer
case TeleportAnimState.TunnelContinue: case TeleportAnimState.TunnelContinue:
_continueElapsed += dt; _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 minMet = worldReady && _continueElapsed >= MinContinue;
bool maxForce = _continueElapsed >= MaxContinue; bool maxForce = _continueElapsed >= MaxContinue;
if (minMet || maxForce) if (minMet || maxForce)
@ -131,9 +129,7 @@ public sealed class TeleportAnimSequencer
if (_elapsed >= FadeTime) if (_elapsed >= FadeTime)
{ {
Advance(TeleportAnimState.WorldFadeIn, enterTunnel: false); Advance(TeleportAnimState.WorldFadeIn, enterTunnel: false);
// Flush exit sound in the same tick:
evts.Add(TeleportAnimEvent.PlayExitSound); evts.Add(TeleportAnimEvent.PlayExitSound);
_exitSoundPending = false;
} }
break; break;
@ -142,7 +138,6 @@ public sealed class TeleportAnimSequencer
{ {
Advance(TeleportAnimState.Off, enterTunnel: false); Advance(TeleportAnimState.Off, enterTunnel: false);
evts.Add(TeleportAnimEvent.FireLoginComplete); evts.Add(TeleportAnimEvent.FireLoginComplete);
_loginCompletePending = false;
} }
break; break;