Skip to content

Commit

Permalink
Merge pull request #903 from azrazalea/warn-stranded-fix-stepladders
Browse files Browse the repository at this point in the history
Ignore all fruit gatherers when checking stranded
  • Loading branch information
myk002 authored Nov 30, 2023
2 parents e8327aa + b17acef commit eb77d46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Template for new versions:
## New Features

## Fixes
- `warn-stranded`: Automatically ignore citizens who are gathering plants or digging to avoid issues with gathering fruit via stepladders and weird issues with digging
- `warn-stranded`: Update onZoom to use df's centering functionality
- `ban-cooking`: fix banning creature alcohols resulting in error

## Misc Improvements
Expand Down
7 changes: 5 additions & 2 deletions warn-stranded.lua
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function WarningWindow:onZoom()
local unit = choice.data['unit']

local target = xyz2pos(dfhack.units.getPosition(unit))
dfhack.gui.revealInDwarfmodeMap(target, false, true)
dfhack.gui.revealInDwarfmodeMap(target, true, true)
end

function WarningWindow:onToggleGroup()
Expand Down Expand Up @@ -334,7 +334,10 @@ local function getStrandedUnits()
or 0
end

if unitIgnored(unit) then
-- Ignore units who are gathering plants or digging to avoid errors with stepladders and weird digging things
if unitIgnored(unit) or (unit.job.current_job and
(unit.job.current_job.job_type == df.job_type.GatherPlants or
df.job_type.attrs[unit.job.current_job.job_type].type == 'Digging')) then
table.insert(ensure_key(ignoredGroup, walkGroup), unit)
else
table.insert(ensure_key(grouped, walkGroup), unit)
Expand Down

0 comments on commit eb77d46

Please sign in to comment.