ResolveOutdoorCellId only resolved outdoor terrain landcells. A player geometrically inside an EnvCell stayed in outdoor-landcell range, so FindEnvCollisions' indoor cell-BSP branch (gated on cellLow >= 0x0100) never fired. Both #84 (blocked by air indoors) and #85 (pass through walls outside→in) are downstream of this — without indoor cell-BSP collision the player gets stuck against outdoor-stab back-faces of the building shell, and walls only block from one side. Adds an indoor-cell-containment check via PhysicsDataCache: at CacheCellStruct time, compute each cell's local AABB from its resolved polygon vertices; at ResolveOutdoorCellId time, transform the world position into each cached cell's local space and return the matched cell's full id when contained. Falls through to the existing outdoor terrain logic when no EnvCell contains the position. Also fixes a pre-existing prefix-preservation bug in the outdoor branch: the function now always applies the matched landblock's high-16 prefix even when the input fallbackCellId arrived bare-low-byte (the L.2e finding from CLAUDE.md). Updated two existing PhysicsEngineTests that encoded the old bare-low-byte output. Evidence: launch-cluster-a-capture.log @ 2026-05-19 — player at worldPos (155.376, 14.010, 94.000) geometrically inside cottage cell 0xA9B40172, but sp.CheckCellId stuck at 0x00000031 (outdoor landcell) across 454 [resolve] lines; zero [indoor-bsp] lines because the gate never opened. Closes #84. Closes #85. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4e308d567a
commit
c19d6fb321
4 changed files with 292 additions and 10 deletions
|
|
@ -207,7 +207,10 @@ public class PhysicsEngineTests
|
|||
|
||||
Assert.True(result.IsOnGround);
|
||||
Assert.InRange(result.Position.X, 24.9f, 25.1f);
|
||||
Assert.Equal(0x0009u, result.CellId);
|
||||
// Phase D fix: ResolveOutdoorCellId now always applies the matched
|
||||
// landblock's high-16 prefix — 0xA9B4 prefix from the registered
|
||||
// landblock (0xA9B4FFFF) is now included in the returned CellId.
|
||||
Assert.Equal(0xA9B40009u, result.CellId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -228,7 +231,10 @@ public class PhysicsEngineTests
|
|||
|
||||
Assert.True(result.IsOnGround);
|
||||
Assert.InRange(result.Position.X, 97.9f, 98.1f);
|
||||
Assert.Equal(0x0025u, result.CellId);
|
||||
// Phase D fix: ResolveOutdoorCellId now always applies the matched
|
||||
// landblock's high-16 prefix — 0xA9B4 prefix from the registered
|
||||
// landblock (0xA9B4FFFF) is now included in the returned CellId.
|
||||
Assert.Equal(0xA9B40025u, result.CellId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue