home · contact · privacy
Don't save non-active world.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 11 Mar 2015 13:15:02 +0000 (14:15 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 11 Mar 2015 13:15:02 +0000 (14:15 +0100)
roguelike-server

index 75606ac32f53c5a995e25f0f0ad2320c242ed8d7..b2d53e35337b87826308de324d859db1effc3018 100755 (executable)
@@ -140,7 +140,8 @@ def obey(command, prefix, replay=False, do_record=False):
                 if time.time() > io_db["save_wait"] + 15:
                     atomic_write(io_db["path_record"], io_db["record_chunk"],
                                  do_append=True)
-                    save_world()
+                    if world_db["WORLD_ACTIVE"]:
+                        save_world()
                     io_db["record_chunk"] = ""
                     io_db["save_wait"] = time.time()
             io_db["worldstate_updateable"] = world_db["WORLD_ACTIVE"]
@@ -1177,7 +1178,8 @@ def command_ping():
 def command_quit():
     """Abort server process."""
     if None == opts.replay:
-        save_world()
+        if world_db["WORLD_ACTIVE"]:
+            save_world()
         atomic_write(io_db["path_record"], io_db["record_chunk"], do_append=True)
     raise SystemExit("received QUIT command")