Skip to content

test: add coverage for autochop, aquifer, burrow, dig-now, regrass (+ Burrows z-coordinate fix) - #5929

Open
Alistair-Afton wants to merge 2 commits into
DFHack:developfrom
Alistair-Afton:test-plugin-coverage-2
Open

Alistair-Afton wants to merge 2 commits into
DFHack:developfrom
Alistair-Afton:test-plugin-coverage-2

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

  • add regression tests for autochop, aquifer, burrow, dig-now, and regrass
  • Burrows: fix stored block z-coordinategetBlockMask/deleteBlockMask computed base + map_pos/16, but map_pos.z is already a z-level, not a tile coordinate. The stored block_z was wrong, so clearTiles, listBlocks, and mask deletion looked up the wrong map block and orphaned the mask: burrow tiles clear and tile copying silently did nothing
  • aquifer: fix --help/-h running a map-wide list instead of printing help (checked a nonexistent help global instead of opts.help)
  • autochop: fix crash when a burrow-based command names a burrow that doesn't exist (autochop_getBurrowConfig returns nothing, and the result was indexed unconditionally)

Test plan

  • all 44 new tests pass in-game
  • full in-game test suite passes (main repo + scripts repo)
  • verified burrow tiles box-add/clear/copy against live fort map state

@Alistair-Afton
Alistair-Afton force-pushed the test-plugin-coverage-2 branch 3 times, most recently from 3579de3 to 71031af Compare September 17, 2026 15:14
block_x/y/z record map block positions in region-wide block coordinates,
but map_pos.z is already a z-level, not a tile coordinate. Dividing it by
16 like x/y stored a wrong block_z, so clearTiles, listBlocks, and mask
deletion looked up the wrong map block and orphaned the tile mask. This
made `burrow tiles clear` and tile copying silently no-op.
Also fixes two issues the new tests exposed: aquifer --help ran a
map-wide list instead of printing help (wrong `help` global checked),
and autochop crashed when a burrow-based command named a burrow that
doesn't exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant