From bae42946d24bd533cdbc1b271ce14acd752689d0 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Tue, 7 Jul 2026 17:04:00 -0400 Subject: feat: standardize new room names to Room # --- internal/admin/api_room_insert_remove.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/admin/api_room_insert_remove.go') diff --git a/internal/admin/api_room_insert_remove.go b/internal/admin/api_room_insert_remove.go index c5ed54a..8549d76 100644 --- a/internal/admin/api_room_insert_remove.go +++ b/internal/admin/api_room_insert_remove.go @@ -66,11 +66,6 @@ func (s *AdminServer) handleRoomInsert(w http.ResponseWriter, r *http.Request) { return } - name := strings.TrimSpace(body.Name) - if name == "" { - name = "New Room" - } - aPath, aPathOK := s.world.GetRoomPath(aID) if !aPathOK { writeJSONError(w, fmt.Sprintf("could not find the file for room #%d", aID), http.StatusInternalServerError) @@ -83,6 +78,11 @@ func (s *AdminServer) handleRoomInsert(w http.ResponseWriter, r *http.Request) { return } + name := strings.TrimSpace(body.Name) + if name == "" { + name = fmt.Sprintf("Room #%d", newID) + } + // Grid-conflict check on a hypothetical post-insert world. conflicts := world.InsertGridConflicts(aID, dir, bID, newID, func(id int) (*world.Room, bool) { r, err := s.world.LoadRoom(id) -- cgit v1.2.3