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/game/cmd_dig.go | 2 +- internal/game/cmd_room_insert.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'internal/game') diff --git a/internal/game/cmd_dig.go b/internal/game/cmd_dig.go index 807f424..e3bc2b5 100644 --- a/internal/game/cmd_dig.go +++ b/internal/game/cmd_dig.go @@ -138,7 +138,7 @@ func (g *Game) executeDig(sess *net.Session, args []string, rawInput string) { if len(args) > 1 { name = strings.Join(args[1:], " ") } else { - name = "New Room" + name = fmt.Sprintf("Room #%d", newID) } oppositeDir := world.OppositeExit[dir] diff --git a/internal/game/cmd_room_insert.go b/internal/game/cmd_room_insert.go index 713c5ee..b248e49 100644 --- a/internal/game/cmd_room_insert.go +++ b/internal/game/cmd_room_insert.go @@ -30,13 +30,6 @@ func (g *Game) roomInsert(sess *net.Session, args []string) { return } - var name string - if len(args) > 1 { - name = strings.Join(args[1:], " ") - } else { - name = "New Room" - } - curPath, ok := g.World.GetRoomPath(p.RoomID) if !ok { sess.WriteLine("Error: can't find current room file.") @@ -71,6 +64,13 @@ func (g *Game) roomInsert(sess *net.Session, args []string) { return } + var name string + if len(args) > 1 { + name = strings.Join(args[1:], " ") + } else { + name = fmt.Sprintf("Room #%d", newID) + } + conflicts := world.InsertGridConflicts(p.RoomID, dir, targetID, newID, func(id int) (*world.Room, bool) { r, err := g.World.LoadRoom(id) if err != nil { -- cgit v1.2.3