home · contact · privacy
Minor optimization in update_map_memory().
authorChristian Heller <c.heller@plomlompom.de>
Mon, 31 Aug 2015 22:56:48 +0000 (00:56 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 31 Aug 2015 22:56:48 +0000 (00:56 +0200)
roguelike-server

index 77c53d44025e821c0b6ad4a5949960f8132bb01f..56354d51e23b3b2a090a0f8fe8b39601c7a15da5 100755 (executable)
@@ -500,10 +500,9 @@ def update_map_memory(t, age_map=True):
             t["T_MEMMAP"][pos] = world_db["MAP"][pos]
     if age_map:
         age_some_memdepthmap_on_nonfov_cells()
-    for mt in [mt for mt in t["T_MEMTHING"]
-               if ord_v == t["fovmap"][(mt[1] * world_db["MAP_LENGTH"])
-                                       + mt[2]]]:
-        t["T_MEMTHING"].remove(mt)
+    t["T_MEMTHING"] = [mt for mt in t["T_MEMTHING"]
+                       if ord_v != t["fovmap"][(mt[1] * world_db["MAP_LENGTH"])
+                                               + mt[2]]]
     for id in [id for id in world_db["Things"]
                if not world_db["Things"][id]["carried"]]:
         type = world_db["Things"][id]["T_TYPE"]