Skip to content

Commit 93fa2d8

Browse files
committed
fix: Allow following specialized rune level plans
With recent changes to stair exploration in a18a5b1, branch-specific plans for navigating to the rune for Swamp were no longer properly triggered. Instead the level exploration code was resetting stair exploration, which made it hard for qw to make much progress, since it had to travel up and try stairs before proceeding further into the cloud generators. This commit has the exploration code not perform a reset if we've autoexplored the rune level and found all upstairs, which will allow the Swamp plans to take over until (hopefully) the rune is found.
1 parent 51d7d32 commit 93fa2d8

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

source/branches.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ function in_hell_branch()
243243
end
244244

245245
function branch_rune_depth(branch)
246+
if not branch_rune(branch) then
247+
return
248+
end
249+
246250
if branch == "Abyss" then
247251
return 3
248252
else

source/gameplans.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ function explored_level(branch, depth)
531531
return autoexplored_level(branch, depth)
532532
and have_all_stairs(branch, depth, DIR.DOWN, FEAT_LOS.REACHABLE)
533533
and have_all_stairs(branch, depth, DIR.UP, FEAT_LOS.REACHABLE)
534-
and (depth < branch_rune_depth(branch) or have_branch_runes(branch))
534+
and (have_branch_runes(branch) or depth < branch_rune_depth(branch))
535535
end
536536

537537
function explored_level_range(range)
@@ -845,8 +845,14 @@ function finalize_exploration_depth(branch, depth)
845845
if depth_up_finished then
846846
if depth_down_finished then
847847
if down_unreach then
848-
level_stair_reset(branch, up_depth, DIR.DOWN)
849-
level_stair_reset(branch, depth, DIR.UP)
848+
-- We don't try stair resets if we're still looking for the
849+
-- rune. This way we'll instead try branch-end-specific
850+
-- plans for e.g. Swamp.
851+
if have_branch_runes(branch)
852+
or depth < branch_rune_depth(branch) then
853+
level_stair_reset(branch, up_depth, DIR.DOWN)
854+
level_stair_reset(branch, depth, DIR.UP)
855+
end
850856
return depth
851857
end
852858

source/variables.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ local plan_explore
215215
local plan_explore2
216216
local plan_move
217217

218-
219218
local plan_orbrun_rest
220219
local plan_orbrun_emergency
221220
local plan_orbrun_move

0 commit comments

Comments
 (0)