aboutsummaryrefslogtreecommitdiff
path: root/internal/game
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-07 17:04:00 -0400
committerhistoria <[not public]>2026-07-07 17:04:00 -0400
commitbae42946d24bd533cdbc1b271ce14acd752689d0 (patch)
treefee984aead607deb7ba14e8736ff2cda942b9642 /internal/game
parent726997d799edc388cd448e978d5bb0755aaa551c (diff)
downloadthehouseoficarus-bae42946d24bd533cdbc1b271ce14acd752689d0.tar.gz
feat: standardize new room names to Room #<id>
Diffstat (limited to 'internal/game')
-rw-r--r--internal/game/cmd_dig.go2
-rw-r--r--internal/game/cmd_room_insert.go14
2 files changed, 8 insertions, 8 deletions
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 {