home · contact · privacy
Fix memory map not updating world map terrain when previously explored.
[plomrogue] / roguelike-server
index ff799fb74a36d86eedaf6cb51b5cebaa2e0c8444..536ab76ffbdea66d43f19110786c6ad1649ed4da 100755 (executable)
@@ -498,12 +498,10 @@ def update_map_memory(t, age_map=True):
         t["T_MEMDEPTHMAP"] = bytearray(b' ' * (world_db["MAP_LENGTH"] ** 2))
     ord_v = ord("v")
     ord_0 = ord("0")
-    ord_space = ord(" ")
     for pos in [pos for pos in range(world_db["MAP_LENGTH"] ** 2)
                 if ord_v == t["fovmap"][pos]]:
         t["T_MEMDEPTHMAP"][pos] = ord_0
-        if ord_space == t["T_MEMMAP"][pos]:
-            t["T_MEMMAP"][pos] = world_db["MAP"][pos]
+        t["T_MEMMAP"][pos] = world_db["MAP"][pos]
     if age_map:
         age_some_memdepthmap_on_nonfov_cells()
     t["T_MEMTHING"] = [mt for mt in t["T_MEMTHING"]
@@ -632,7 +630,6 @@ def actor_move(t):
                                      t["T_POSY"], t["T_POSX"])
     if 1 == move_result[0]:
         pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
-        passable = "." == chr(world_db["MAP"][pos])
         hitted = [id for id in world_db["Things"]
                   if world_db["Things"][id] != t
                   if world_db["Things"][id]["T_LIFEPOINTS"]
@@ -651,6 +648,7 @@ def actor_move(t):
                                                 " wounds you.\n")
             decrement_lifepoints(world_db["Things"][hit_id])
             return
+        passable = "." == chr(world_db["MAP"][pos])
     dir = [dir for dir in directions_db
            if directions_db[dir] == chr(t["T_ARGUMENT"])][0]
     if passable: