Repository navigation
aquifer: honor --skip-top and top-relative --levels - #5906
Merged
Merged
Conversation
Alistair-Afton
force-pushed
the
aquifer-skip-top
branch
2 times, most recently
from
September 15, 2026 03:06
61c247c to
be1bd4b
Compare
The drain, convert, and add actions accepted skip_top and levels parameters but never applied them, so e.g. 'aquifer drain --all --skip-top 2' silently removed every aquifer on the map instead of keeping the top two aquifer levels. Per the documented semantics these options only take effect with the --all target, so a top_relative flag is threaded through from the Lua CLI: drain/convert count down from the topmost existing aquifer level and add counts from the topmost level that can hold an aquifer tile, via the existing get_z_range helper that previously only served the list action. get_z_range also now clamps to the explicit range's upper bound instead of ignoring it, so 'aquifer list <pos> <pos>' and '-z' no longer report levels above the requested range.
Alistair-Afton
force-pushed
the
aquifer-skip-top
branch
from
September 15, 2026 03:16
be1bd4b to
24f68eb
Compare
ab9rf
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aquifer drain,convert, andaddacceptedskip_topandlevelsparameters but never applied them, so e.g.aquifer drain --all --skip-top 2silently removed every aquifer on the map instead of keeping the top two aquifer levels (fixes #5709).Per the documented semantics these options only take effect with
--all, so atop_relativeflag is threaded through from the Lua CLI:drain/convertcount down from the topmost existing aquifer level andaddcounts from the topmost level that can hold an aquifer tile, via the existingget_z_rangehelper.get_z_rangealso now clamps to the explicit range's upper bound instead of ignoring it, soaquifer list <pos> <pos>and-zno longer report levels above the requested range.Testing
drain --all --skip-top 2kept the top 2 aquifer levels and drained below;add --all --skip-top 2 --levels 5added exactly the 5 expected levels;convert heavy --all --skip-top 2converted below the top 2drain/listunaffectedlight-aquifers-only(aquifer convert light --all) behavior unchangedci/lint.pyclean; plugin builds cleanly