home · contact · privacy
Server/py: Fix writing out TT_CORPSE_ID commands to early to save file.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 28 Feb 2015 14:34:40 +0000 (15:34 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 28 Feb 2015 14:34:40 +0000 (15:34 +0100)
plomrogue-server.py

index eb1267157f2a6598c347e10ab7b895721c7090cc..092355bb43de61b72b8f8522a0d10c1a72099945 100755 (executable)
@@ -133,14 +133,17 @@ def save_world():
                                 str(tt["TT_CONSUMABLE"]) + "\n" + \
                                 "TT_LIFEPOINTS " + \
                                 str(tt["TT_LIFEPOINTS"]) + "\n" + \
-                                "TT_CORPSE_ID " + \
-                                str(tt["TT_CORPSE_ID"]) + "\n" + \
                                 "TT_PROLIFERATE " + \
                                 str(tt["TT_PROLIFERATE"]) + "\n" + \
                                 "TT_START_NUMBER " + \
                                 str(tt["TT_START_NUMBER"]) + "\n" + \
                                 "TT_NAME '" + tt["TT_NAME"] + "'\n" + \
                                 "TT_SYMBOL '" + tt["TT_SYMBOL"] + "'\n"
+    for id in world_db["ThingTypes"]:
+        tt = world_db["ThingTypes"][id]
+        tt_string = tt_string + "TT_ID " + str(id) + "\n" + \
+                                "TT_CORPSE_ID " + \
+                                str(tt["TT_CORPSE_ID"]) + "\n"
     atomic_write(io_db["path_save"],
                  "WORLD_ACTIVE " + str(world_db["WORLD_ACTIVE"]) + "\n" +
                  "MAP_LENGTH " + str(world_db["MAP_LENGTH"]) + "\n" +