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:
566bdd3
)
Server/py: Fix randomness retrieval bug.
author
Christian Heller
<c.heller@plomlompom.de>
Sat, 7 Mar 2015 15:25:22 +0000
(16:25 +0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sat, 7 Mar 2015 15:25:22 +0000
(16:25 +0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index a44f751313a057e04c432f5ba48df264a9d4e222..adbada39cec822041a1c667985eae6f0ada835d1 100755
(executable)
--- a/
plomrogue-server.py
+++ b/
plomrogue-server.py
@@
-465,7
+465,7
@@
def remake_map():
# This all-too-precise replica of the original C code misses iter_limit().
# This all-too-precise replica of the original C code misses iter_limit().
-def update_map_memory(t):
+def update_map_memory(t
, age_map=True
):
"""Update t's T_MEMMAP with what's in its FOV now,age its T_MEMMEPTHMAP."""
if not t["T_MEMMAP"]:
t["T_MEMMAP"] = bytearray(b' ' * (world_db["MAP_LENGTH"] ** 2))
"""Update t's T_MEMMAP with what's in its FOV now,age its T_MEMMEPTHMAP."""
if not t["T_MEMMAP"]:
t["T_MEMMAP"] = bytearray(b' ' * (world_db["MAP_LENGTH"] ** 2))
@@
-477,7
+477,7
@@
def update_map_memory(t):
if " " == chr(t["T_MEMMAP"][pos]):
t["T_MEMMAP"][pos] = world_db["MAP"][pos]
continue
if " " == chr(t["T_MEMMAP"][pos]):
t["T_MEMMAP"][pos] = world_db["MAP"][pos]
continue
- if ord('0') <= t["T_MEMDEPTHMAP"][pos] \
+ if
age_map and
ord('0') <= t["T_MEMDEPTHMAP"][pos] \
and ord('9') > t["T_MEMDEPTHMAP"][pos] \
and not rand.next() % (2 ** (t["T_MEMDEPTHMAP"][pos] - 48)):
t["T_MEMDEPTHMAP"][pos] += 1
and ord('9') > t["T_MEMDEPTHMAP"][pos] \
and not rand.next() % (2 ** (t["T_MEMDEPTHMAP"][pos] - 48)):
t["T_MEMDEPTHMAP"][pos] += 1