Skip to content

Fix trains overrunning stations and being unable to pathfind to current station#9876

Open
HB-Stratos wants to merge 2 commits intoCreators-of-Create:mc1.21.1/devfrom
HB-Stratos:mc1.21.1/overshoot-fix
Open

Fix trains overrunning stations and being unable to pathfind to current station#9876
HB-Stratos wants to merge 2 commits intoCreators-of-Create:mc1.21.1/devfrom
HB-Stratos:mc1.21.1/overshoot-fix

Conversation

@HB-Stratos
Copy link

This PR fixes an issue where in very specific rail network shapes a train could overrun the station it intended to stop at by a minuscule amount. If the train was given a looping schedule sending it only to the station it is currently stopped at (and there was another station of the same name in the network), the train would discard its current station from the pathfinding calculation as it was technically behind it on the initial edge of the graph, and thus the train would leave towards the other station with the same name despite already being at a valid target.

This fix is implemented by selectively patching out a seeming bodge that makes trains always overshoot their target by 0.25 blocks. Testing on my end has not shown any change in behavior (other than stations working correctly) from patching this overshoot code out when a train is approaching a station instead of a signal. It is possible that the bodge could be removed completely, but this was the minimum possible to fix the current issue.

@VoidLeech VoidLeech added pr type: fix PR fixes a bug pr flag: simple PR has minimal changes labels Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr flag: simple PR has minimal changes pr type: fix PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants