From: Christian Heller Date: Sun, 13 Mar 2016 19:45:08 +0000 (+0100) Subject: TCE: Only calc_effort on tiles where it makes sense. X-Git-Tag: tce~10 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/bar%20baz.html?a=commitdiff_plain;h=8a4a2982bd510e3cb90d7d9060c71d8deec23161;p=plomrogue TCE: Only calc_effort on tiles where it makes sense. --- diff --git a/plugins/server/TheCrawlingEater.py b/plugins/server/TheCrawlingEater.py index c9854b5..02c9c3c 100644 --- a/plugins/server/TheCrawlingEater.py +++ b/plugins/server/TheCrawlingEater.py @@ -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