From 6e92d2bab27353c21390abcf07eeee3d51fc64da Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Tue, 1 Sep 2015 01:41:53 +0200
Subject: [PATCH] Re-insert map existence check in command_worldactive().

---
 roguelike-server | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/roguelike-server b/roguelike-server
index 7e59152..e723339 100755
--- a/roguelike-server
+++ b/roguelike-server
@@ -1285,10 +1285,9 @@ def command_worldactive(worldactive_string):
     """Toggle world_db["WORLD_ACTIVE"] if possible.
 
     An active world can always be set inactive. An inactive world can only be
-    set active with a "wait" ThingAction, and a player Thing (of ID 0). On
-    activation, rebuild all Things' FOVs, and the player's map memory.
+    set active with a "wait" ThingAction, and a player Thing (of ID 0), and a
+    map. On activation, rebuild all Things' FOVs, and the player's map memory.
     """
-    # In original version, map existence was also tested (unnecessarily?).
     val = integer_test(worldactive_string, 0, 1)
     if val:
         if 0 != world_db["WORLD_ACTIVE"]:
@@ -1307,7 +1306,7 @@ def command_worldactive(worldactive_string):
                 if 0 == Thing:
                     player_exists = True
                     break
-            if wait_exists and player_exists:
+            if wait_exists and player_exists and "MAP" in world_db:
                 for id in world_db["Things"]:
                     if world_db["Things"][id]["T_LIFEPOINTS"]:
                         build_fov_map(world_db["Things"][id])
-- 
2.30.2