aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_room_insert.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_room_insert.go')
-rw-r--r--internal/game/cmd_room_insert.go14
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 {