From 4ef80d1a51ec7bdd00f4877a464a805a3c05b8fb Mon Sep 17 00:00:00 2001 From: partmedia Date: Sat, 17 Aug 2019 05:54:39 +0000 Subject: [PATCH] Add herustic to get cart stuck less often git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@20959 282e977c-c81d-0410-88c4-b93c2d0d6712 --- python/items/roll-o-matic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/items/roll-o-matic.py b/python/items/roll-o-matic.py index 5ac71341e..af742a160 100644 --- a/python/items/roll-o-matic.py +++ b/python/items/roll-o-matic.py @@ -60,6 +60,9 @@ def handle_move(): for check in [0, 1, -1]: d = abs_dir(want_dir + check) if has_floor(x + dir_x[d], y + dir_y[d], floor): + # Next time, move in the direction we last moved in. + # This heuristic helps follow the roads better. + me.WriteKey(key_direction, str(d)) if me.Move(d) == 0: continue