diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-21 07:12:38 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-21 07:12:38 +0000 |
commit | 7ab388d144d5870c4a93f21d3c7f2c11e7aa05b6 (patch) | |
tree | 7adc970639d69c029f4c51ed3f7e62d0b682cfa0 /crawl-ref/source/travel.cc | |
parent | c9c0dd88de40c87decbec120f6670e869dcac672 (diff) | |
download | crawl-ref-7ab388d144d5870c4a93f21d3c7f2c11e7aa05b6.tar.gz crawl-ref-7ab388d144d5870c4a93f21d3c7f2c11e7aa05b6.zip |
Another small improvement to the anti-zigzag algorithm. Also, the
pathological case took only 20% more turns, not 50% more.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3109 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r-- | crawl-ref/source/travel.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index af6f5e8573..07efdd4afe 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -928,15 +928,17 @@ static void explore_find_target_square() // Has moving along the straight line found an unexplored // square? - if (!is_terrain_seen(target + delta) && target != you.pos()) + if (!is_terrain_seen(target + delta) && target != you.pos() + && target != whereto) { // Auto-explore is only zigzagging if the prefered // target (whereto) and the anti-zigzag target are // close together. if (grid_distance(target.x, target.y, whereto.x, whereto.y) <= 5 - && (distance(target.x, target.y, - whereto.x, whereto.y) <= 34)) + && distance(target.x, target.y, + whereto.x, whereto.y) <= 34) + //&& t_dist - w_dist <= 14) { set_target_square(target); return; |