home · contact · privacy
TCE: Fix actor_move bug (separation of bowel filling, wall disposal).
authorChristian Heller <c.heller@plomlompom.de>
Fri, 11 Mar 2016 10:36:54 +0000 (11:36 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 11 Mar 2016 10:36:54 +0000 (11:36 +0100)
plugins/server/TheCrawlingEater.py

index 7a634165d8e83249426a9a0a3e0f708e2e88e5cb..7c05e78c8874323288191f1805137a0438d8eb1b 100644 (file)
@@ -147,17 +147,21 @@ def actor_move(t):
     else:
         if t["T_BOWEL"] >= 32 or chr(world_db["MAP"][pos]) == "X":
             return
-        elif chr(world_db["MAP"][pos]) == "%" and 0 == int(rand.next() % 2):
+        eaten = False
+        if chr(world_db["MAP"][pos]) == "%" and 0 == int(rand.next() % 2):
             t["T_BOWEL"] += 3
+            eaten = True
         elif chr(world_db["MAP"][pos]) in "#BEH" and 0 == int(rand.next() % 5):
             t["T_BOWEL"] += 4
+            eaten = True
         log("You EAT.")
-        if world_db["wetmap"][pos] == 48:
-            world_db["MAP"][pos] = ord("_")
-        else:
-            world_db["MAP"][pos] = ord("~")
-        if t["T_BOWEL"] > 32:
-            t["T_BOWEL"] = 32
+        if eaten:
+            if world_db["wetmap"][pos] == 48:
+                world_db["MAP"][pos] = ord("_")
+            else:
+                world_db["MAP"][pos] = ord("~")
+            if t["T_BOWEL"] > 32:
+                t["T_BOWEL"] = 32
 
 
 def make_map():