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

Change: Towns don't build dead-end road bridges #8401

Merged
merged 1 commit into from Dec 24, 2020

Conversation

@2TallTyler
Copy link
Member

@2TallTyler 2TallTyler commented Dec 19, 2020

(I broke GitHub on my previous PR branch and even TrueBrain couldn't fix it, so I'm starting over on a fresh branch.)

Currently, towns build bridges over ocean tiles or tracks without checking if the tile past the bridge will allow them to continue building the road. This frequently leads to bridges dead-ending at industries, houses, tracks, etc.

I have created a test savegame to demonstrate each case where the bridge should be allowed, and each case where it should be prohibited. You can run it on fast-forward to let the towns grow (I have included buses to drive growth). You can tell that a bridge has been rejected when the town grows the road to the end of the tile without bridging.

Bridge_Test_Save.zip

src/town_cmd.cpp Outdated Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
@2TallTyler 2TallTyler force-pushed the no_dead_end_bridges_2 branch from 8efd6b1 to b4de2fc Dec 20, 2020
src/town_cmd.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@glx22 glx22 left a comment

Maybe more optimisations

src/town_cmd.cpp Outdated Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
Copy link
Member

@TrueBrain TrueBrain left a comment

Really close now, nice work :) And super you attach a savegame to test, that is awesome!

src/town_cmd.cpp Outdated Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
src/town_cmd.cpp Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
@2TallTyler 2TallTyler force-pushed the no_dead_end_bridges_2 branch from 6b9465b to 815f7c5 Dec 23, 2020
@2TallTyler 2TallTyler requested a review from TrueBrain Dec 23, 2020
@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Dec 24, 2020

image

wauw .... that is one hell of an impressive savegame to test with! I wish everyone would go through this length of testing ...

@michicc michicc merged commit 7bdfb38 into OpenTTD:master Dec 24, 2020
8 checks passed
@2TallTyler 2TallTyler deleted the no_dead_end_bridges_2 branch Dec 24, 2020
2TallTyler added a commit to 2TallTyler/OpenTTD that referenced this issue Jan 8, 2021
2TallTyler added a commit to 2TallTyler/OpenTTD that referenced this issue Jan 8, 2021
2TallTyler added a commit to 2TallTyler/OpenTTD that referenced this issue Jan 8, 2021
@2TallTyler 2TallTyler restored the no_dead_end_bridges_2 branch Feb 24, 2021
@2TallTyler 2TallTyler deleted the no_dead_end_bridges_2 branch Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants