diff options
| author | historia <[not public]> | 2026-09-18 18:38:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 18:38:35 -0400 |
| commit | 1f118d79e319da4e765502e9ca5b661772de94f1 (patch) | |
| tree | bca8a3fd1e538f1c302480511e6ba872c92e10b8 /internal/admin | |
| parent | 5ad42a51df4dcc5ccc3aa6a6d902085ce2ee4239 (diff) | |
| download | thehouseoficarus-1f118d79e319da4e765502e9ca5b661772de94f1.tar.gz | |
refactor: casino table core; fix: stake/migration/validation gaps
Diffstat (limited to 'internal/admin')
| -rw-r--r-- | internal/admin/api_rooms.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/admin/api_rooms.go b/internal/admin/api_rooms.go index 015c0ee..32a6f1c 100644 --- a/internal/admin/api_rooms.go +++ b/internal/admin/api_rooms.go @@ -631,8 +631,7 @@ func (s *AdminServer) handleRoomLink(w http.ResponseWriter, r *http.Request) { } } - conflicts := 0 - testGrid := world.BuildGrid(s.cfg.StartingRoom, func(id int) (*world.Room, bool) { + conflicts := world.BuildGridConflicts(s.cfg.StartingRoom, func(id int) (*world.Room, bool) { room, err := s.world.LoadRoom(id) if err != nil { log.Printf("link: conflict test BuildGrid failed to load room %d: %v", id, err) @@ -657,12 +656,9 @@ func (s *AdminServer) handleRoomLink(w http.ResponseWriter, r *http.Request) { roomCopy.Exits[oppDir] = world.ExitDef{Room: body.From} } return &roomCopy, true - }, nil, nil, func(gc world.GridConflict) { - conflicts++ }) - _ = testGrid - if conflicts > 0 { + if len(conflicts) > 0 { writeJSONError(w, "link would cause map conflicts (twists or overlaps)", http.StatusConflict) return } |
