Reapply "feat(physics): A4 — wire CheckOtherCells into FindEnvCollisions"

This reverts commit 3add110449.
This commit is contained in:
Erik 2026-05-20 20:06:14 +02:00
parent 3add110449
commit 691493e579
2 changed files with 164 additions and 1 deletions

View file

@ -1502,7 +1502,7 @@ public sealed class Transition
}
}
private TransitionState FindEnvCollisions(PhysicsEngine engine)
internal TransitionState FindEnvCollisions(PhysicsEngine engine)
{
var sp = SpherePath;
var ci = CollisionInfo;
@ -1618,6 +1618,21 @@ public sealed class Transition
return cellState;
}
// ── Phase A4 (2026-05-20): query every other cell ──────────
// Retail oracle: CTransition::check_other_cells at
// acclient_2013_pseudo_c.txt:272717-272798. The vestibule
// walls bug (cell 0xA9B40164 has only 4 polys; adjacent
// 0xA9B40157 has the actual walls) closes here.
//
// Discard the containing-cell return — sp.CheckCellId is
// already authoritative for the primary cell we just queried.
_ = CellTransit.FindCellSet(engine.DataCache, footCenter, sphereRadius,
sp.CheckCellId, out var cellSet);
var otherCellsState = CheckOtherCells(engine, footCenter, sphereRadius, cellSet);
if (otherCellsState != TransitionState.OK)
return otherCellsState;
// ──────────────────────────────────────────────────────────
// ── Synthesize indoor walkable contact plane ──────────────
// Indoor walking Phase 2 follow-up (2026-05-19). When the BSP
// returns OK (no wall collision), the player is standing on a