diff options
| author | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 16:13:49 -0400 |
| commit | 194164a77eb4f2479b94c19e6f0e1278ab608781 (patch) | |
| tree | 53413add8ed6f32a34d1733397e380cc98ef70ef /internal/game/cmd_dig.go | |
| parent | 67e01aab85607b9e601185c7d62dff576af3bb43 (diff) | |
| download | thehouseoficarus-194164a77eb4f2479b94c19e6f0e1278ab608781.tar.gz | |
fix: more casino, economy, gameplay, security, and world data hardening gaps
Diffstat (limited to 'internal/game/cmd_dig.go')
| -rw-r--r-- | internal/game/cmd_dig.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/game/cmd_dig.go b/internal/game/cmd_dig.go index 1497c34..c58ba63 100644 --- a/internal/game/cmd_dig.go +++ b/internal/game/cmd_dig.go @@ -63,7 +63,7 @@ func (g *Game) executeDig(sess *net.Session, args []string, rawInput string) { sess.WriteLine("Error updating current room YAML.") return } - if err := os.WriteFile(curPath, curData, 0644); err != nil { + if err := writeRoomFile(curPath, curData); err != nil { sess.WriteLine("Error writing current room file.") return } @@ -75,7 +75,9 @@ func (g *Game) executeDig(sess *net.Session, args []string, rawInput string) { if ok { conflictData, cerr := yaml.Marshal(conflictRoom) if cerr == nil { - os.WriteFile(conflictPath, conflictData, 0644) + if werr := writeRoomFile(conflictPath, conflictData); werr != nil { + sess.WriteLine(fmt.Sprintf("Warning: could not link the opposite exit in room %d: %v", conflictID, werr)) + } } } } @@ -161,7 +163,7 @@ func (g *Game) executeDig(sess *net.Session, args []string, rawInput string) { sess.WriteLine("Error creating directory.") return } - if err := os.WriteFile(newPath, data, 0644); err != nil { + if err := writeRoomFile(newPath, data); err != nil { sess.WriteLine("Error writing room file.") return } @@ -174,7 +176,7 @@ func (g *Game) executeDig(sess *net.Session, args []string, rawInput string) { sess.WriteLine("Error updating current room YAML.") return } - if err := os.WriteFile(curPath, curData, 0644); err != nil { + if err := writeRoomFile(curPath, curData); err != nil { sess.WriteLine("Error writing current room file.") return } |
