From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 13 Mar 2016 11:11:51 +0000 (+0100)
Subject: TCE: Fix ai command mix up bug.
X-Git-Tag: tce~20
X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/add_task?a=commitdiff_plain;h=7cd0ed7e2deb006eef71618c890d37a974cdf655;p=plomrogue

TCE: Fix ai command mix up bug.
---

diff --git a/plugins/server/TheCrawlingEater.py b/plugins/server/TheCrawlingEater.py
index 898f102..9ef3aff 100644
--- a/plugins/server/TheCrawlingEater.py
+++ b/plugins/server/TheCrawlingEater.py
@@ -13,9 +13,11 @@ def command_help(str_int):
 
 
 def command_ai():
-    if world_db["WORLD_ACTIVE"]:
-        world_db["ai"](world_db["Things"][0])
-        world_db["turn_over"]()
+    if not (world_db["WORLD_ACTIVE"]
+            and world_db["Things"][0]["T_LIFEPOINTS"] > 0):
+        return
+    world_db["ai"](world_db["Things"][0])
+    world_db["turn_over"]()
 
 
 def play_drink():
@@ -381,16 +383,6 @@ def turn_over():
 world_db["turn_over"] = turn_over
 
 
-def command_ai():
-    """Call ai() on player Thing, then turn_over()."""
-    if not (world_db["WORLD_ACTIVE"]
-            and world_db["Things"][0]["T_LIFEPOINTS"] > 0):
-        return
-    from server.ai import ai
-    ai(world_db["Things"][0])
-    world_db["turn_over"]()
-
-
 def set_command(action):
     """Set player's T_COMMAND, then call turn_over()."""
     tid = [x for x in world_db["ThingActions"]