home · contact · privacy
TCE: Fix ai command mix up bug.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 13 Mar 2016 11:11:51 +0000 (12:11 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 13 Mar 2016 11:11:51 +0000 (12:11 +0100)
plugins/server/TheCrawlingEater.py

index 898f1025a3cd3065e6bbc9fbf06a1e2adcdbb831..9ef3aff4b1c7f1ac3d3764b87ee248f181d480b8 100644 (file)
@@ -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"]