Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[emigration] remove emigrating units from burrows #1069

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Template for new versions:
- `fix/loyaltycascade`: fix lookup of associated unit metadata when the metadata list is sparse (that is, the script was sometimes failing to fix the loyalties of renegade units because it was failing to find those units' metadata)
- `quickfort`: reject tiles for building that contain magma or deep water
- `armoks-blessing`: fix error when making class "Normal" attributes legendary
- `emigration`: remove units from burrows when they emigrate

## Misc Improvements
- `gui/reveal`: show aquifers even when not in mining mode
Expand Down
8 changes: 5 additions & 3 deletions emigration.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
--Allow stressed dwarves to emigrate from the fortress
-- For 34.11 by IndigoFenix; update and cleanup by PeridexisErrant
-- old version: http://dffd.bay12games.com/file.php?id=8404
--@module = true
--@enable = true

Expand Down Expand Up @@ -81,6 +78,11 @@ function desert(u,method,civ)
end
end

-- unburrow
for _, burrow in ipairs(df.global.plotinfo.burrows.list) do
dfhack.burrows.setAssignedUnit(burrow, u, false)
end

-- erase the unit from the fortress entity
for k,v in ipairs(fort_ent.histfig_ids) do
if v == hf_id then
Expand Down