Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Reverse at signal timeouts occur unexpectedly quickly, affects title game #7159
Version of OpenTTD
master: from commit e934f09 onwards
When _settings_game.pf.reverse_at_signals is true, reversing of trains at a red signal occurs after the interval given by _settings_game.pf.wait_oneway_signal or _settings_game.pf.wait_twoway_signal.
When _settings_game.pf.reverse_at_signals is true, reversing of trains at a red signal occurs at a shorter interval than expected.
Steps to reproduce
Watch the title game for a few minutes, diesel trains going over the bridge at the top occasionally reverse on the bridge or in the the signal block prior to the bridge, due to moderate delays which are less than that given by _settings_game.pf.wait_oneway_signal. This did not occur prior to commit e934f09 and is probably undesirable in the title game.
Train::wait_counter is only used for one thing in this case.
No, it is not a pathfinder issue. Reverting e934f09 is sufficient to resolve the issue.
With the current code, a train waiting at a one-way signal will increment wait_counter twice each tick, i.e. on both
Previously, the update rate of wait_counter depended on train speed and acceleration. For example train 2 from the title game (Turner Turbo) incremented wait_counter every ten ticks, while train 12 (Lev4) incremented every five ticks.
The easiest change would be to the factor in the