fix(core): UCG Stage 1 — final-review polish (VisibleCells null-guard, Neighbor doc)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-02 09:44:14 +02:00
parent 8e703bef22
commit f2663b7e4b
2 changed files with 8 additions and 2 deletions

View file

@ -66,8 +66,9 @@ public sealed class EnvCell : ObjCell
}
uint lbPrefix = id & 0xFFFF0000u;
var stab = new List<uint>(datCell.VisibleCells.Count);
foreach (var low in datCell.VisibleCells) stab.Add(lbPrefix | low);
var stab = new List<uint>();
if (datCell.VisibleCells is not null) // match BuildLoadedCell:5701 null guard
foreach (var low in datCell.VisibleCells) stab.Add(lbPrefix | low);
bool seenOutside = datCell.Flags.HasFlag(EnvCellFlags.SeenOutside);
return new EnvCell(id, worldTransform, inverse, min, max, portals, stab,