home · contact · privacy
New client: Read in player position and map size.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 28 Nov 2015 11:44:13 +0000 (12:44 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 28 Nov 2015 11:44:13 +0000 (12:44 +0100)
client_prototype.py

index bed6400196463c65ade82d006625791477c32c19..a6256294c40a8c0ecb3b19cc53ee836658789018 100644 (file)
@@ -195,6 +195,9 @@ def read_worldstate():
             if line == '%':
                 break
             world_data["inventory"] += [line]
+        world_data["position"][0] = int(worldstate_file.readline())
+        world_data["position"][1] = int(worldstate_file.readline())
+        world_data["map_size"] = int(worldstate_file.readline())
     worldstate_file.close()
 read_worldstate.last_checked_mtime = -1
 
@@ -341,6 +344,8 @@ world_data = {
     "inventory": [],
     "lifepoints": -1,
     "log": [],
+    "map_size": -1,
+    "position": [-1, -1],
     "satiation": -1,
     "turn": -1
 }