home · contact · privacy
TCE: Only calc_effort on tiles where it makes sense.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 13 Mar 2016 19:45:08 +0000 (20:45 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 13 Mar 2016 19:45:08 +0000 (20:45 +0100)
plugins/server/TheCrawlingEater.py

index c9854b52c507bbc077f0ec905321067eb09de92b..02c9c3c0872f70137c249f0674a4bc87e8eda2f5 100644 (file)
@@ -310,8 +310,9 @@ def calc_effort(ta, t):
                                          t["T_POSY"], t["T_POSX"])
         if 1 == move_result[0]:
             pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
-            narrowness = world_db["MAP"][pos] - ord("0")
-            return 2 ** narrowness
+            if chr(world_db["MAP"][pos]) in "012":
+                narrowness = world_db["MAP"][pos] - ord("0")
+                return 2 ** narrowness
     return 1
 world_db["calc_effort"] = calc_effort