home · contact · privacy
In actor_move(), don't test target cell passability earlier than needed.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 1 Sep 2015 02:14:55 +0000 (04:14 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 1 Sep 2015 02:14:55 +0000 (04:14 +0200)
roguelike-server

index ff799fb74a36d86eedaf6cb51b5cebaa2e0c8444..8ae2ba7b4ed43db3eb3733703222476f223d36fb 100755 (executable)
@@ -632,7 +632,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 +650,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: