From 2ec189c106ed9d741124ac040e54fe70739c8491 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 8 Jun 2026 19:08:14 +0200 Subject: [PATCH] =?UTF-8?q?fix(render):=20R-A2=20seam=20fix=20=E2=80=94=20?= =?UTF-8?q?flood=20null-BuildingId=20cells=20instead=20of=20dropping=20the?= =?UTF-8?q?m?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MergeNearbyBuildingFloods skipped cells whose BuildingId is null; the pre-R-A2 outdoor-node reverse-portal flood reached them, so dropping left holes at building/terrain seams. Key by (BuildingId ?? CellId) so unstamped/outdoor-adjacent exit-portal cells still seed a per-entrance flood; cells without an exit portal contribute nothing as before. App Rendering 207/207. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.App/Rendering/RetailPViewRenderer.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/AcDream.App/Rendering/RetailPViewRenderer.cs b/src/AcDream.App/Rendering/RetailPViewRenderer.cs index e994a311..5bf7bd45 100644 --- a/src/AcDream.App/Rendering/RetailPViewRenderer.cs +++ b/src/AcDream.App/Rendering/RetailPViewRenderer.cs @@ -110,12 +110,17 @@ public sealed class RetailPViewRenderer foreach (var cell in ctx.NearbyBuildingCells!) { - if (cell.BuildingId is not uint buildingId) - continue; // outdoor surface cells (no building) don't flood - if (!_buildingGroups.TryGetValue(buildingId, out var group)) + // R-A2 seam fix: a cell without a BuildingId (unstamped, or outdoor-adjacent with an exit + // portal) must STILL flood — the pre-R-A2 node flood reached it via a reverse portal, so + // dropping it (the original `continue`) left holes at building/terrain seams. Key it by its + // own CellId → a singleton per-entrance flood: a cell with an exit portal seeds from it, a + // cell with none contributes nothing (same as before). BuildingId/CellId key collisions are + // harmless — BuildFromExterior seeds each exit-portal cell in a group independently. + uint groupKey = cell.BuildingId ?? cell.CellId; + if (!_buildingGroups.TryGetValue(groupKey, out var group)) { group = new List(); - _buildingGroups[buildingId] = group; + _buildingGroups[groupKey] = group; } group.Add(cell); }