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

Desync related to diagonal track next to dock end #8119

Closed
Yexo opened this issue May 6, 2020 · 4 comments
Closed

Desync related to diagonal track next to dock end #8119

Yexo opened this issue May 6, 2020 · 4 comments

Comments

@Yexo
Copy link
Contributor

Yexo commented May 6, 2020

Version of OpenTTD

1.10.1, also head as of bc83337

CmdBuildRailroadTrack does not keep the 'is dockable' tile status bit intact. (CmdBuildSingleRail does). This can easily lead to a desync.

To reproduce, load the attached savegame. The ship is able to dock at Benfingford Docks. When you remove/rebuild the diagonal tracks, the ship can no longer dock. Any client that connects after rebuilding the tracks will instantly desync since the ship can still dock on the client.

desync.zip

@frosch123
Copy link
Member

Looks like various calls to SetDockingTile must be replaced with calls to CheckForDockingTile. The latter also updates the station's area.

@LordAro
Copy link
Member

LordAro commented May 6, 2020

This is likely the desync-immediately-after-join seen by @ldpl in #8093

SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue May 8, 2020
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue May 8, 2020
SamuXarick added a commit to SamuXarick/OpenTTD that referenced this issue May 9, 2020
@glx22
Copy link
Contributor

glx22 commented May 9, 2020

Quick test using the provided savegame and desync debug

cmd: 000ade87; 09; 00; 0006cf; 000006cf; 00000000; 0dd3004b; "(null)" (CmdClearArea)
station docking mismatch: station 0, company 0
cmd: 000ade8a; 43; 00; 0006cf; 00000000; 00000005; 0e600002; "(null)" (CmdBuildSingleRail) station docking mismatch: station 0, company 0
cmd: 000ade8c; 39; 00; 0006cf; 00000000; 00000005; 0e610003; "(null)" (CmdRemoveSingleRail)
cmd: 000ade8e; 11; 00; 0006cf; 00000000; 00000005; 0e600002; "(null)" (CmdBuildSingleRail)
station docking mismatch: station 0, company 0

@glx22 glx22 closed this as completed in a95fbd5 May 9, 2020
@glx22 glx22 changed the title Desync after building diagonal track next to dock end Desync related to diagonal track next to dock end May 9, 2020
@glx22
Copy link
Contributor

glx22 commented May 9, 2020

Desync still happens when destroying (not removing) the diagonal rail track in the attached save

@glx22 glx22 reopened this May 9, 2020
LordAro pushed a commit to LordAro/OpenTTD that referenced this issue May 10, 2020
LordAro pushed a commit that referenced this issue Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants