From 210d6a216ecfd22d1ea8be5f80b2a38fb092a87b Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 10 Mar 2015 20:31:35 +0100
Subject: [PATCH] Fix replay mode overwriting save file on quit.

---
 roguelike-server | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/roguelike-server b/roguelike-server
index ffc75e6..98a92df 100755
--- a/roguelike-server
+++ b/roguelike-server
@@ -1141,8 +1141,9 @@ def command_ping():
 
 def command_quit():
     """Abort server process."""
-    save_world()
-    atomic_write(io_db["path_record"], io_db["record_chunk"], do_append=True)
+    if None == opts.replay:
+        save_world()
+        atomic_write(io_db["path_record"], io_db["record_chunk"], do_append=True)
     raise SystemExit("received QUIT command")
 
 
-- 
2.30.2