diff options
| author | historia <[not public]> | 2026-07-07 17:04:00 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-07 17:04:00 -0400 |
| commit | bae42946d24bd533cdbc1b271ce14acd752689d0 (patch) | |
| tree | fee984aead607deb7ba14e8736ff2cda942b9642 /internal/game/cmd_room_insert.go | |
| parent | 726997d799edc388cd448e978d5bb0755aaa551c (diff) | |
| download | thehouseoficarus-bae42946d24bd533cdbc1b271ce14acd752689d0.tar.gz | |
feat: standardize new room names to Room #<id>
Diffstat (limited to 'internal/game/cmd_room_insert.go')
| -rw-r--r-- | internal/game/cmd_room_insert.go | 14 |
1 files changed, 7 insertions, 7 deletions
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 { |
