home · contact · privacy
Fix replay mode overwriting save file on quit.
[plomrogue] / roguelike-server
index adba9bcd586d5873ecd4ed8c2bfec32682401604..57f0b6c1bc737dd92c8ebd3e14fa9bca2697c662 100755 (executable)
@@ -625,8 +625,8 @@ def actor_move(t):
             if t == world_db["Things"][0]:
                 hitted_type = world_db["Things"][hit_id]["T_TYPE"]
                 hitted_name = world_db["ThingTypes"][hitted_type]["TT_NAME"]
-                strong_write(io_db["file_out"], "LOG You wound " + hitted +
-                                                ".\n")
+                strong_write(io_db["file_out"], "LOG You wound "
+                                                + hitted_name + ".\n")
             elif 0 == hit_id:
                 hitter_name = world_db["ThingTypes"][t["T_TYPE"]]["TT_NAME"]
                 strong_write(io_db["file_out"], "LOG " + hitter_name +
@@ -1111,8 +1111,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")