From: Christian Heller Date: Thu, 12 Mar 2015 14:58:03 +0000 (+0100) Subject: In actor_move(), don't test target cell passability earlier than needed. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/decks/todo?a=commitdiff_plain;h=0eb28cf849ea804c4a2e560df9c73b03cd1ecc73;p=plomrogue In actor_move(), don't test target cell passability earlier than needed. --- diff --git a/roguelike-server b/roguelike-server index 40bfcb8..53cd751 100755 --- a/roguelike-server +++ b/roguelike-server @@ -741,9 +741,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]) or - ":" == chr(world_db["MAP"][pos]) or # # - "_" == 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"] @@ -765,6 +762,9 @@ def actor_move(t): if test and t == world_db["Things"][0]: # # add_gods_favor(-test) # # return + passable = ("." == chr(world_db["MAP"][pos]) or + ":" == chr(world_db["MAP"][pos]) or # # + "_" == chr(world_db["MAP"][pos])) # # dir = [dir for dir in directions_db if directions_db[dir] == chr(t["T_ARGUMENT"])][0] if passable: