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-b93c2d0d6712master
parent
4d904cbe9c
commit
4ef80d1a51
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue