From 14fca6c5dabaeadeef1761d5b7b6dd252784ee42 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sat, 7 Mar 2015 05:49:35 +0100
Subject: [PATCH] Server/py: Handle mv_yx_in_dir_legal argument bug.

---
 plomrogue-server.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plomrogue-server.py b/plomrogue-server.py
index 78cf88c..a3c8f8f 100755
--- a/plomrogue-server.py
+++ b/plomrogue-server.py
@@ -574,7 +574,7 @@ def decrement_lifepoints(t):
 
 def mv_yx_in_dir_legal(dir, y, x):
     """Wrapper around libpr.mv_yx_in_dir_legal to simplify its use."""
-    dir_c = chr(dir).encode("ascii")[0]
+    dir_c = dir.encode("ascii")[0]
     test = libpr.mv_yx_in_dir_legal_wrap(dir_c, y, x)
     if -1 == test:
         raise RuntimeError("Too much wrapping in mv_yx_in_dir_legal_wrap()!")
@@ -590,7 +590,8 @@ def actor_wait(t):
 def actor_move(t):
     """If passable, move/collide(=attack) thing into T_ARGUMENT's direction."""
     passable = False
-    move_result = mv_yx_in_dir_legal(t["T_ARGUMENT"], t["T_POSY"], t["T_POSX"])
+    move_result = mv_yx_in_dir_legal(chr(t["T_ARGUMENT"]),
+                                     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])
-- 
2.30.2