home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d49987d
)
Server/py: Handle mv_yx_in_dir_legal argument bug.
author
Christian Heller
<c.heller@plomlompom.de>
Sat, 7 Mar 2015 04:49:35 +0000
(
05:49
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sat, 7 Mar 2015 04:49:35 +0000
(
05:49
+0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index 78cf88c5aa0594a6475c4c96d9bbd94374d01f56..a3c8f8fd27e25d0a89a04d3ed64a7938fd54b0e0 100755
(executable)
--- 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."""
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()!")
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
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])
if 1 == move_result[0]:
pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
passable = "." == chr(world_db["MAP"][pos])