home · contact · privacy
7DRL: Exclude map cells with actors in FOV on them from stack depth map.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 13 Mar 2015 20:14:42 +0000 (21:14 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 13 Mar 2015 20:14:42 +0000 (21:14 +0100)
roguelike-server

index 9bc55ad815bb6fe788720016b05c1e6c1979ef02..cb6b3dd0c97f142392a9c46544f9c9319a705de6 100755 (executable)
@@ -361,6 +361,15 @@ def try_worldstate_update():
         string = write_map(string, mem)
 
         stacksmap = bytearray(b'0' * (length ** 2))  # #
+        for id in [id for id in world_db["Things"]  # #
+                      if not world_db["Things"][id]["carried"]  # #
+                      if world_db["Things"][id]["T_LIFEPOINTS"]
+                      if world_db["Things"][0]["fovmap"][  # #
+                           world_db["Things"][id]["T_POSY"] * length  # #
+                           + world_db["Things"][id]["T_POSX"]] == ord_v]:  # #
+            pos = (world_db["Things"][id]["T_POSY"] * length  # #
+                  + world_db["Things"][id]["T_POSX"])  # #
+            stacksmap[pos] = ord('X')  # #
         for id in [id for id in world_db["Things"]  # #
                       if not world_db["Things"][id]["carried"]  # #
                       if world_db["Things"][0]["fovmap"][  # #