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 (parent:
f6a542c
)
Server/py: Fix bug in command_thingshere().
author
Christian Heller
<c.heller@plomlompom.de>
Sat, 7 Mar 2015 03:53:40 +0000
(
04:53
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sat, 7 Mar 2015 03:53:40 +0000
(
04:53
+0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index de1bd420cd2a54650c1b036798e1686081ec5505..22a84519373d77b55afee6cbb6ffe879ec864902 100755
(executable)
--- a/
plomrogue-server.py
+++ b/
plomrogue-server.py
@@
-909,13
+909,6
@@
def command_quit():
def command_thingshere(str_y, str_x):
"""Write to out file list of Things known to player at coordinate y, x."""
def command_thingshere(str_y, str_x):
"""Write to out file list of Things known to player at coordinate y, x."""
- def write_thing_if_here():
- if y == world_db["Things"][id]["T_POSY"] \
- and x == world_db["Things"][id]["T_POSX"] \
- and not world_db["Things"][id]["carried"]:
- type = world_db["Things"][id]["T_TYPE"]
- name = world_db["ThingTypes"][type]["TT_NAME"]
- strong_write(io_db["file_out"], name + "\n")
if world_db["WORLD_ACTIVE"]:
y = integer_test(str_y, 0, 255)
x = integer_test(str_x, 0, 255)
if world_db["WORLD_ACTIVE"]:
y = integer_test(str_y, 0, 255)
x = integer_test(str_x, 0, 255)
@@
-925,10
+918,18
@@
def command_thingshere(str_y, str_x):
strong_write(io_db["file_out"], "THINGS_HERE START\n")
if "v" == chr(world_db["Things"][0]["fovmap"][pos]):
for id in world_db["Things"]:
strong_write(io_db["file_out"], "THINGS_HERE START\n")
if "v" == chr(world_db["Things"][0]["fovmap"][pos]):
for id in world_db["Things"]:
- write_thing_if_here()
+ # write_thing_if_here()
+ if y == world_db["Things"][id]["T_POSY"] \
+ and x == world_db["Things"][id]["T_POSX"] \
+ and not world_db["Things"][id]["carried"]:
+ type = world_db["Things"][id]["T_TYPE"]
+ name = world_db["ThingTypes"][type]["TT_NAME"]
+ strong_write(io_db["file_out"], name + "\n")
else:
else:
- for id in world_db["Things"][0]["T_MEMTHING"]:
- write_thing_if_here()
+ for mt in world_db["Things"][0]["T_MEMTHING"]:
+ if y == mt[1] and x == mt[2]:
+ name = world_db["ThingTypes"][mt[0]]["TT_NAME"]
+ strong_write(io_db["file_out"], name + "\n")
strong_write(io_db["file_out"], "THINGS_HERE END\n")
else:
print("Ignoring: Invalid map coordinates.")
strong_write(io_db["file_out"], "THINGS_HERE END\n")
else:
print("Ignoring: Invalid map coordinates.")