aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_room_remove.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_room_remove.go')
-rw-r--r--internal/game/cmd_room_remove.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/game/cmd_room_remove.go b/internal/game/cmd_room_remove.go
index af745fd..77a09b3 100644
--- a/internal/game/cmd_room_remove.go
+++ b/internal/game/cmd_room_remove.go
@@ -180,7 +180,7 @@ func (g *Game) roomRemove(sess *net.Session, args []string) {
sess.WriteLine("Error updating current room YAML.")
return
}
- if err := os.WriteFile(aPath, aData, 0644); err != nil {
+ if err := writeRoomFile(aPath, aData); err != nil {
sess.WriteLine("Error writing current room file.")
return
}
@@ -198,7 +198,9 @@ func (g *Game) roomRemove(sess *net.Session, args []string) {
if cPathOK {
cData, cerr := yaml.Marshal(cRoom)
if cerr == nil {
- os.WriteFile(cPath, cData, 0644)
+ if werr := writeRoomFile(cPath, cData); werr != nil {
+ sess.WriteLine(fmt.Sprintf("Warning: could not link the opposite exit in room %d: %v", cID, werr))
+ }
}
}