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

Remove posible infinite loop in place_roads #44968

Merged

Conversation

John-Candlebury
Copy link
Member

Summary

SUMMARY: Bugfixes "Remove possible infinite loop in place_roads"

Purpose of change

This should fix #44736

Describe the solution

Rework the way the random out of the overmap road connections are chosen in a way that removes the posibility of infinite loops. Might be better ways to evaluate the points than with a rather large shuffled array. I wouldnt know them however.

Testing

Make a world with Aftershock enabled and teleport across lake overmaps several times, experience no crashes.

At least that was my experience.

Additional context

There can be other mapgen related hangups when lakes get ever larger, I tried lake sizes 0.01 to 0.05 and all caused hangups. Aftershock's size of 0.12 seems safe with this change, at the least.

@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/crash-when-reading-road-trail-ect-maps/24899/13

@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Oct 20, 2020
@ZhilkinSerg ZhilkinSerg merged commit ea096c2 into CleverRaven:master Oct 20, 2020
@John-Candlebury John-Candlebury deleted the fix-road-infinite-loop branch October 20, 2020 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Game freeze in overmap::place_roads
4 participants