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

(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
src/town_cmd.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@glx22 glx22 left a comment

Choose a reason for hiding this comment

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

Maybe more optimisations

src/town_cmd.cpp Outdated Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
@TrueBrain TrueBrain added candidate: yes This Pull Request is a candidate for being merged size: small This Pull Request is small, and should be relative easy to process labels Dec 20, 2020
Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

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

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
@TrueBrain TrueBrain added the work: minor details This Pull Request has some minor details left to do label Dec 22, 2020
src/town_cmd.cpp Outdated Show resolved Hide resolved
@TrueBrain
Copy link
Member

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
@2TallTyler 2TallTyler deleted the no_dead_end_bridges_2 branch December 24, 2020 23:45
2TallTyler added a commit to 2TallTyler/OpenTTD that referenced this pull request Jan 8, 2021
2TallTyler added a commit to 2TallTyler/OpenTTD that referenced this pull request Jan 8, 2021
2TallTyler added a commit to 2TallTyler/OpenTTD that referenced this pull request Jan 8, 2021
@2TallTyler 2TallTyler restored the no_dead_end_bridges_2 branch February 24, 2021 21:44
@2TallTyler 2TallTyler deleted the no_dead_end_bridges_2 branch February 27, 2021 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: yes This Pull Request is a candidate for being merged size: small This Pull Request is small, and should be relative easy to process work: minor details This Pull Request has some minor details left to do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants