From 194164a77eb4f2479b94c19e6f0e1278ab608781 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 16:13:49 -0400 Subject: fix: more casino, economy, gameplay, security, and world data hardening gaps --- internal/game/cmd_room_mob.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'internal/game/cmd_room_mob.go') diff --git a/internal/game/cmd_room_mob.go b/internal/game/cmd_room_mob.go index ced170f..ce729d4 100644 --- a/internal/game/cmd_room_mob.go +++ b/internal/game/cmd_room_mob.go @@ -2,7 +2,6 @@ package game import ( "fmt" - "os" "gopkg.in/yaml.v3" "thehouseoficarus/internal/net" @@ -44,7 +43,10 @@ func (g *Game) roomAddMob(sess *net.Session, args []string) { path, _ := g.World.GetRoomPath(p.RoomID) data, _ := yaml.Marshal(room) - os.WriteFile(path, data, 0644) + if err := writeRoomFile(path, data); err != nil { + sess.WriteLine(fmt.Sprintf("Error saving room: %v", err)) + return + } sess.WriteLine(fmt.Sprintf("Added mob '%s' to room.", mobID)) } @@ -77,6 +79,9 @@ func (g *Game) roomRemMob(sess *net.Session, args []string) { path, _ := g.World.GetRoomPath(p.RoomID) data, _ := yaml.Marshal(room) - os.WriteFile(path, data, 0644) + if err := writeRoomFile(path, data); err != nil { + sess.WriteLine(fmt.Sprintf("Error saving room: %v", err)) + return + } sess.WriteLine(fmt.Sprintf("Removed mob '%s' from room.", mobID)) } -- cgit v1.2.3