Skip to content

quickfix: repair unassigned site_id on reclaimed fortresses - #5948

Merged
ab9rf merged 2 commits into
DFHack:developfrom
Alistair-Afton:quickfix-site-id
Sep 21, 2026
Merged

ab9rf merged 2 commits into
DFHack:developfrom
Alistair-Afton:quickfix-site-id

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

Implements the mitigation discussed in #5937: on map load, if plotinfo.site_id is still -1 (a vanilla defect on reclaimed fortresses until the first save), it is restored from plotinfo.main.fortress_site, which is set at embark.

Lives in quickfix alongside the existing entity race repair, called from onMapLoad.default.init. Silent unless it actually repairs something.

Testing

  • New test/modules/quickfix_fortress.lua: fabricates the defect (site_id = -1), verifies the repair restores fortress_site.id, and verifies a no-op when site_id is already assigned.
  • 2/2 tests, 3/3 checks pass in-game on 53.16.

Comment thread docs/changelog.txt Outdated
- `timestream`: deal properly with units who have breathing difficulties
- `stocks`: overlay now resets scroll position when collapsing categories so the item list is no longer left blank and unscrollable
- Fixed persistent site data API (``dfhack.persistent.saveSiteData``/``getSiteData``) failing on newly reclaimed fortresses until the first save
- ``quickfix``: repair ``plotinfo.site_id`` on load when DF leaves it unassigned on reclaimed fortresses

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a "fix"; fixes are changes that fix a defect in DFHack. Because it provides a mitigation for a defect in DF, this is a new feature and thus should be placed in that category.

@ab9rf
ab9rf merged commit 4c200c8 into DFHack:develop Sep 21, 2026
14 checks passed
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.

2 participants