fix(physics): Phase A8.F — viewer sweeps bypass the 30-step cap (retail-faithful)

Retail's CTransition::find_transitional_position (:273613) has no step
cap. calc_num_steps (:272149) has a dedicated viewer branch `if ((state
& 4) != 0)` at :272181 for sight/viewer objects (ObjectInfoState.IsViewer
= 0x4). The existing acdream cap correctly had a comment "Sight objects
bypass this" but the bypass was never wired — no IsViewer caller existed
until the A8.F camera spring-arm.

With radius 0.3 m the cap fires at ~9 m. The spring-arm sweeps up to
40 m (≈134 steps), so zoomed-out cameras snapped to the player's head
instead of sweeping through geometry. The fix adds `&& !ObjectInfo.IsViewer`
to the guard; non-viewers keep the 30-step safety net (player spheres
~0.48 m radius never exceed 14 m/tick).

Conformance test: radius=0.3, dist=12 (40 steps > 30 cap) over flat
terrain. Normal mover bails (Assert.False). Viewer proceeds to target
(Assert.True + CurPos.X > from.X). RED → GREEN.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-29 20:35:26 +02:00
parent 53634b5089
commit 7a244b3291
2 changed files with 36 additions and 2 deletions

View file

@ -698,8 +698,14 @@ public sealed class Transition
offsetPerStep = Vector3.Zero;
}
// Retail safety cap (30 steps). Sight objects bypass this.
if (numSteps > PhysicsGlobals.MaxTransitionSteps)
// Retail safety cap (30 steps). Viewer/sight objects bypass it, matching
// retail: CTransition::find_transitional_position (acclient_2013_pseudo_c.txt
// :273613) has no cap, and calc_num_steps (:272149) has a dedicated viewer
// branch `if ((state & 4) != 0)` at :272181. The A8.F camera spring-arm
// (IsViewer) sweeps the eye far past 30 steps; the zoom clamp (≤40 m / 0.3 m
// radius ≈ 134 steps) bounds it. Non-viewers keep the safety net (players
// never exceed it: 30 × 0.48 m ≈ 14 m/tick).
if (numSteps > PhysicsGlobals.MaxTransitionSteps && !ObjectInfo.IsViewer)
return false;
// Apply free rotation if requested.