From a5d4ead1795882d25da7eda53680d2a84590693d Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 3 Jul 2026 20:53:00 -0400 Subject: feat: admin map can add new and rename areas. works with empty directories now. --- internal/validate/checks.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'internal/validate') diff --git a/internal/validate/checks.go b/internal/validate/checks.go index ccf996c..974998a 100644 --- a/internal/validate/checks.go +++ b/internal/validate/checks.go @@ -1024,6 +1024,39 @@ func validateRoomGrid(s Source) []Issue { } } + onConf := func(origin int) func(c world.GridConflict) { + return func(c world.GridConflict) { + switch c.Kind { + case "twist": + issues = append(issues, Issue{ + Level: "ERROR", + Type: "integrity", + Message: fmt.Sprintf( + "Grid twist: room %d (via %d %s) maps to (%d,%d,%d) but was already placed at (%d,%d,%d) [origin %d]", + c.Target, c.From, c.Dir, c.Want[0], c.Want[1], c.Want[2], c.Existing[0], c.Existing[1], c.Existing[2], origin), + }) + case "overlap": + issues = append(issues, Issue{ + Level: "ERROR", + Type: "integrity", + Message: fmt.Sprintf( + "Grid overlap: room %d (via %d %s) wants (%d,%d,%d), already used by room %d [origin %d]", + c.Target, c.From, c.Dir, c.Want[0], c.Want[1], c.Want[2], c.Occupier, origin), + }) + } + } + } + + for id := range roomIndex { + if placed[id] { + continue + } + grid := world.BuildGrid(id, load, include, onConf(id)) + for rid := range grid.Coord { + placed[rid] = true + } + } + return issues } -- cgit v1.2.3