X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=plomrogue-server.py;h=a3c8f8fd27e25d0a89a04d3ed64a7938fd54b0e0;hb=14fca6c5dabaeadeef1761d5b7b6dd252784ee42;hp=be83c6a04a8ba5ea19a9524874a3fcd8d36421db;hpb=45697f87b57832be3ca365439a9260e5faf3eb9b;p=plomrogue diff --git a/plomrogue-server.py b/plomrogue-server.py index be83c6a..a3c8f8f 100755 --- a/plomrogue-server.py +++ b/plomrogue-server.py @@ -204,8 +204,10 @@ def save_world(): string = "" for key in world_db: - if dict != type(world_db[key]) and key != "MAP": + if dict != type(world_db[key]) and key != "MAP" and \ + key != "WORLD_ACTIVE" and key != "SEED_MAP": string = string + key + " " + str(world_db[key]) + "\n" + string = string + "SEED_MAP " + str(world_db["SEED_MAP"]) + "\n" string = string + helper("ThingActions", "TA_ID") string = string + helper("ThingTypes", "TT_ID", {"TT_CORPSE_ID": False}) for id in world_db["ThingTypes"]: @@ -572,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()!") @@ -588,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])