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

Fix: Desync after house replacement #8151

Merged
merged 1 commit into from May 18, 2020

Conversation

ldpl
Copy link
Contributor

@ldpl ldpl commented May 15, 2020

Digging through #7603 (comment). This fixes the desync that happens in Town::stations_near after the town replaces a house in 1.10.1 and master(83cd040).

Steps to reproduce (in master): run with -d desync=2, load attached save, unpause.

house-replacement-acceptance-desync.zip

Unlike JGRennison/OpenTTD-patches@326dfd3 this fix also handles the case when house was relocated.
Also improved the performance of RemoveNearbyStations as it's now called more often.

@ldpl ldpl force-pushed the house-rebuild-desync branch 2 times, most recently from 20d6772 to 62123f4 Compare May 15, 2020 20:29
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

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

Nothing major. Just for my own piece of mind, can you explain how this fixes the desync?

src/town_cmd.cpp Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
src/town_cmd.cpp Outdated Show resolved Hide resolved
@ldpl
Copy link
Contributor Author

ldpl commented May 16, 2020

@LordAro what do you mean? It handles house replacement correctly by moving RemoveNearbyStations to ClearTownHouse so it gets updated every time house is removed (new houses are already updating it). Instead of trying to handle all the building size and location changes after house rebuilding.

@LordAro
Copy link
Member

LordAro commented May 16, 2020

That's exactly what I mean ;)

@ldpl ldpl force-pushed the house-rebuild-desync branch 2 times, most recently from a1155c4 to a4e545b Compare May 16, 2020 19:57
@LordAro LordAro added the backport requested This PR should be backport to current release (RC / stable) label May 18, 2020
@LordAro LordAro merged commit 93d1d87 into OpenTTD:master May 18, 2020
@ldpl ldpl deleted the house-rebuild-desync branch July 14, 2020 08:27
@LordAro LordAro added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants