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

gui/pathable crashes with multiple depots when one is underwater #4903

Closed
vityav opened this issue Sep 2, 2024 · 3 comments · Fixed by #4909
Closed

gui/pathable crashes with multiple depots when one is underwater #4903

vityav opened this issue Sep 2, 2024 · 3 comments · Fixed by #4909

Comments

@vityav
Copy link

vityav commented Sep 2, 2024

I've found (don't ask how) that if you have multiple trade depots, and one has been submerged underwater, that running gui/pathable and clicking on the depot tab will lock up the game. After finding this I tested a number of situations to try to narrow it down and it seems that there have to be multiple depots and one must be underwater (not merely inaccessible). Any other conditions seem to work fine. I tested with the underwater depot both in a completely sealed room, and behind a grate that led out to the ocean, and both conditions behaved the same. Using liquids to drain the water in any crashing situation led to it working. Adding the water back and running again would return to crashing.

A Exists A Accessible A Submerged B Exists B Accessible B Submerged ✔️Works/Crashes❌
✔️ ✔️ ✔️
✔️ ✔️ ✔️
✔️ ✔️ ✔️ ✔️ ✔️
✔️ ✔️ ✔️ ✔️
✔️ ✔️ ✔️ ✔️

Version: Windows 50.13-r4

@vityav
Copy link
Author

vityav commented Sep 3, 2024

Adding a save for debugging.
region6.zip

@myk002 myk002 added the bug label Sep 3, 2024
@lethosor
Copy link
Member

lethosor commented Sep 3, 2024

Speculation: I think there is a special "not walkable" tile group, which is probably getting assigned here if the depot itself is truly submerged (i.e. not just in an enclosed room that happens to be submerged and unreachable). We may not be handling depots with that group assigned correctly. I can't easily explain why that would only happen if two depots are present from a quick look at pathable.cpp, though.

@vityav
Copy link
Author

vityav commented Sep 3, 2024

If I edit line 316 in pathable.cpp; if (!cache_scan_for_painting) to if (cache_scan_for_painting) (or just edit out the if statement entirely) , it works. It paths to the non-submerged depot, indicates all submerged tiles as impassible, and everything seems to behave the way I'd expect without it (including zooming between available depots if I make them both accessible).

I can also just edit out the call to wagon_flood and get incorrect results but no crash. I don't know why wagon_flood works if my only depot is submerged but fails when it's one of multiple depots, though. I feel like somewhere something is getting set to indicate that a depot should be accessible, and then the loop checks for routes to all depots expecting them all to be accessible? I'm still digging but calling it a night for now.

Functioning example:
2024-09-03 01_50_59-Dwarf Fortress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants