From: Christian Heller Date: Mon, 2 Mar 2015 04:50:00 +0000 (+0100) Subject: Server/py: Extend command_worldactive(). X-Git-Tag: tce~443 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bdb.prefix%7D%7D/day?a=commitdiff_plain;h=0a970d55ce04846b1314f5615dfd33efc6a5be4c;p=plomrogue Server/py: Extend command_worldactive(). --- diff --git a/plomrogue-server.py b/plomrogue-server.py index 4cb138a..94925ed 100755 --- a/plomrogue-server.py +++ b/plomrogue-server.py @@ -382,14 +382,18 @@ def command_worldactive(worldactive_string): set_world_inactive() elif 0 == world_db["WORLD_ACTIVE"]: wait_exists = False + for ThingAction in world_db["ThingActions"]: + if "wait" == ThingAction["TA_NAME"]: + wait_exists = True + break player_exists = False - map_exists = False - # TODO: perform tests: - # Is there thing action of name 'wait'? - # Is there a player thing? - # Is there a map? + for Thing in world_db["Things"]: + if 0 == ThingAction["T_ID"]: + player_exists = True + break + map_exists = "MAP" in world_db if wait_exists and player_exists and map_exists: - # TODO: rebuild al things' FOVs, map memories + # TODO: rebuild all things' FOVs, map memories world_db["WORLD_ACTIVE"] = 1