From: Christian Heller Date: Tue, 1 Sep 2015 02:14:55 +0000 (+0200) Subject: In actor_move(), don't test target cell passability earlier than needed. X-Git-Tag: tce~293 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/static/template?a=commitdiff_plain;h=5e352d367bfe737b0544a0be2095c2fe44959d79;p=plomrogue In actor_move(), don't test target cell passability earlier than needed. --- diff --git a/roguelike-server b/roguelike-server index ff799fb..8ae2ba7 100755 --- a/roguelike-server +++ b/roguelike-server @@ -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: