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

Ignore all fruit gatherers when checking stranded #903

Merged
merged 7 commits into from
Nov 30, 2023

Conversation

azrazalea
Copy link
Contributor

Did some testing on this. It definitely works to ignore citizens gathering fruit. I haven't ran into any issues of false positives so far, but we should still keep an eye on it

warn-stranded.lua Outdated Show resolved Hide resolved
@azrazalea
Copy link
Contributor Author

I think ideally we need to pick up on whatever the DF is using to have these dwarves pathfind out of difficult situations by climbing and check that instead but I have no clue what that is

@ab9rf
Copy link
Member

ab9rf commented Nov 27, 2023

I think ideally we need to pick up on whatever the DF is using to have these dwarves pathfind out of difficult situations by climbing and check that instead but I have no clue what that is

the trigger for that is a pathfinding failure, which would require us to invoke the pathfinder, which (a) we cannot do and (b) would cause the very lag we're trying to avoid

Copy link
Member

@myk002 myk002 left a comment

Choose a reason for hiding this comment

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

Don't forget the changelog entry!

@@ -334,7 +334,8 @@ local function getStrandedUnits()
or 0
end

if unitIgnored(unit) then
-- Ignore units who are gathering plants to avoid errors with stepladders
if unitIgnored(unit) or (unit.job.current_job and unit.job.current_job.job_type == df.job_type.GatherPlants) then
Copy link
Member

Choose a reason for hiding this comment

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

I suggest also ignoring mining job types since they can un-strand themselves. There's a handy attr in df.job_types you can check instead of having to itemize all the dig job types

Copy link
Member

Choose a reason for hiding this comment

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

df.job_type.attrs[unit.job.current_job.job_type].type == 'Digging'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, I'll get that added tonight

@azrazalea
Copy link
Contributor Author

image

@myk002 myk002 merged commit eb77d46 into DFHack:master Nov 30, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants