diff options
-rw-r--r-- | crawl-ref/docs/crawl_options.txt | 2 | ||||
-rw-r--r-- | crawl-ref/source/travel.cc | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt index 2220f30511..084d77f651 100644 --- a/crawl-ref/docs/crawl_options.txt +++ b/crawl-ref/docs/crawl_options.txt @@ -636,7 +636,7 @@ explore_improved = false auto-explore. On average it increases the number of turns taken by about 0.9%, sometimes actually speeding it up slightly and sometimes increasing the turns taken by up to 5%, with - pathological cases causing a 20% increase. + pathological cases causing a 13% increase. tc_reachable = blue tc_dangerous = cyan diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 07efdd4afe..8cbbc9740f 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -894,18 +894,22 @@ static void explore_find_target_square() } // If the two previous travel moves are perpendicular to each - // other. + // other... if (prev_travel_moves[0] != -1 && prev_travel_moves[1] != -1 && (abs(prev_travel_moves[1] - prev_travel_moves[0]) % 4) == 2) { + ASSERT(anti_zigzag_dir == -1); + // Try moving along the line that bisects the right angle. - if (abs(prev_travel_moves[0] - prev_travel_moves[1]) == 6) - anti_zigzag_dir = 0; + if ((abs(prev_travel_moves[0] - prev_travel_moves[1]) == 6) + && (prev_travel_moves[0] + prev_travel_moves[1] == 8)) + { + anti_zigzag_dir = 0; + } else anti_zigzag_dir = std::min(prev_travel_moves[0], prev_travel_moves[1]) + 1; - } // anti_zigzag_dir might have just been set, or might have @@ -938,7 +942,6 @@ static void explore_find_target_square() whereto.x, whereto.y) <= 5 && distance(target.x, target.y, whereto.x, whereto.y) <= 34) - //&& t_dist - w_dist <= 14) { set_target_square(target); return; |