Skip to content

Commit

Permalink
Don't let explore options impact connectivity checks
Browse files Browse the repository at this point in the history
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 56e1b8f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crawl-ref/source/travel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 56e1b8f

Please sign in to comment.