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:
d8143f0
)
Fix map invalidation in command_maplength().
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 1 Sep 2015 00:57:26 +0000
(
02:57
+0200)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 1 Sep 2015 00:57:26 +0000
(
02:57
+0200)
roguelike-server
patch
|
blob
|
history
diff --git
a/roguelike-server
b/roguelike-server
index 860cd1ad2a47129df5a8f88ebd45e20bf7e69cc3..edd0579d4cac9e27778ecff8c7e9806986c34665 100755
(executable)
--- a/
roguelike-server
+++ b/
roguelike-server
@@
-1271,6
+1271,7
@@
def command_maplength(maplength_string):
val = integer_test(maplength_string, 1, 256)
if None != val:
world_db["MAP_LENGTH"] = val
val = integer_test(maplength_string, 1, 256)
if None != val:
world_db["MAP_LENGTH"] = val
+ world_db["MAP"] = False
set_world_inactive()
world_db["Things"] = {}
libpr.set_maplength(val)
set_world_inactive()
world_db["Things"] = {}
libpr.set_maplength(val)
@@
-1301,7
+1302,7
@@
def command_worldactive(worldactive_string):
if 0 == Thing:
player_exists = True
break
if 0 == Thing:
player_exists = True
break
- if wait_exists and player_exists and
"MAP" in world_db
:
+ if wait_exists and player_exists and
world_db["MAP"]
:
for id in world_db["Things"]:
if world_db["Things"][id]["T_LIFEPOINTS"]:
build_fov_map(world_db["Things"][id])
for id in world_db["Things"]:
if world_db["Things"][id]["T_LIFEPOINTS"]:
build_fov_map(world_db["Things"][id])
@@
-1425,12
+1426,12
@@
def setter_map(maptype):
val = valid_map_line(str_int, mapline)
if None != val:
length = world_db["MAP_LENGTH"]
val = valid_map_line(str_int, mapline)
if None != val:
length = world_db["MAP_LENGTH"]
- if not
"MAP" in world_db
:
+ if not
world_db["MAP"]
:
map = bytearray(b' ' * (length ** 2))
else:
map = world_db["MAP"]
map[val * length:(val * length) + length] = mapline.encode()
map = bytearray(b' ' * (length ** 2))
else:
map = world_db["MAP"]
map[val * length:(val * length) + length] = mapline.encode()
- if not
"MAP" in world_db
:
+ if not
world_db["MAP"]
:
world_db["MAP"] = map
@test_Thing_id
world_db["MAP"] = map
@test_Thing_id
@@
-1623,6
+1624,7
@@
world_db = {
"MAP_LENGTH": 64,
"PLAYER_TYPE": 0,
"WORLD_ACTIVE": 0,
"MAP_LENGTH": 64,
"PLAYER_TYPE": 0,
"WORLD_ACTIVE": 0,
+ "MAP": False,
"ThingActions": {},
"ThingTypes": {},
"Things": {}
"ThingActions": {},
"ThingTypes": {},
"Things": {}