RR7 visual gate (2026-05-27) revealed the indoor branch NEVER fired even
when the strict gate's PointInCell + non-null CameraCell hit: 17,748
inside=True frames, 0 branch=indoor decisions. Root cause: RR4 wired
BuildingLoader.Build with the per-frame drainedCells dict — cells that
streamed in on earlier frames (the common case, since cells arrive
asynchronously over many frames after the landblock-info completion)
were not in drainedCells, so the BFS short-circuited and the registry's
EnvCellIds set was systematically incomplete. Cells loaded ahead of
lbInfo arrival never got their BuildingId stamped.
Fix has two parts:
1. CellVisibility.AllLoadedCells — new public IReadOnlyDictionary
exposing the existing private _cellLookup. BuildingLoader.Build at
landblock-info-arrival now walks the full cell set, not just this
frame's drain.
2. _pendingCells drain loop — late-stamps BuildingId on each arriving
cell if its landblock's BuildingRegistry already exists. Covers cells
that arrive AFTER the registry-build pass.
Together these handle all four timing cases:
- Cells loaded before lbInfo arrives → stamped in BuildingLoader.Build
- Cells loaded with lbInfo (same frame) → stamped in BuildingLoader.Build
- Cells loaded after lbInfo arrives → stamped in drain loop
- lbInfo never arrives (LB has no info) → registry never built, cells
stay at BuildingId == null
(intended — flow through outdoor
render path)
Probe data from the failed gate launch confirmed cell 0xA9B40150
(cottage idx=6 cellar from the #98 saga) was reached as the camera cell
with visN=16 visible neighbours, but BuildingId stayed null. This fix
gets the indoor branch fired in that scenario.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>