Skip to content
Permalink
Browse files

Don't let explore options impact connectivity checks

This was impacting seed stability: this code is called in various
contexts, including stair checks / vault exit checks, plus from some lua
code. The returned coordinate could be different depending on these
options. The options that could potentially matter are
`explore_wall_bias` and `explore_item_greed`, though I suspect the
latter won't. The former I have verified to matter on seed
18127138284784505733 (UV4's game of the month seed right now), where
setting it to 1 prior to this commit produces a different dungeon than
the default value of 0.  Thanks to u/kitchen_ace for noticing that
deleting their rc file changed the dungeon, otherwise I'm not sure I
would have ever found this bug.
  • Loading branch information...
rawlins committed Mar 6, 2019
1 parent 64c5a76 commit 56e1b8fd0ee2b8544c10cc44545a6ac9b36759c4
Showing with 6 additions and 3 deletions.
  1. +6 −3 crawl-ref/source/travel.cc
@@ -1211,8 +1211,8 @@ coord_def travel_pathfind::pathfind(run_mode_type rmode, bool fallback_explore)
unexplored_place = greedy_place = coord_def(0, 0);
unexplored_dist = greedy_dist = UNFOUND_DIST;

refdist = (Options.explore_item_greed > 0) ? &unexplored_dist
: &greedy_dist;
refdist = (runmode == RMODE_CONNECTIVITY || Options.explore_item_greed > 0)
? &unexplored_dist : &greedy_dist;

// Zap out previous distances array: this must happen before the
// early exit checks below, since callers may want to inspect
@@ -1286,8 +1286,11 @@ coord_def travel_pathfind::pathfind(run_mode_type rmode, bool fallback_explore)
{
if (runmode == RMODE_TRAVEL)
return travel_move();
else if (!Options.explore_wall_bias)
else if (runmode == RMODE_CONNECTIVITY
|| !Options.explore_wall_bias)
{
return explore_target();
}
else
found_target = true;
}

0 comments on commit 56e1b8f

Please sign in to comment.
You can’t perform that action at this time.