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
master
partmedia 2019-08-17 05:54:39 +00:00
parent 4d904cbe9c
commit 4ef80d1a51
1 changed files with 3 additions and 0 deletions

View File

@ -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