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

Motion counter continues to increase while train is waiting at non-path signals #5877

Closed
DorpsGek opened this issue Jan 25, 2014 · 5 comments
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Pikka opened the ticket and wrote:

Tested in trunk r26275.

The motion counter for vehicles keeps increasing while a train is waiting at a NON-path (ie, original block or presignal). This means trains with animated wheels will sit at these signals with their wheels spinning.

Path signals work as expected.

Test grf and demonstration savegame attached.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5877
@DorpsGek
Copy link
Member Author

frosch wrote:

Potential fix, but maybe there is a better one:
http://paste.openttdcoop.org/show/3117/


This comment was imported from FlySpray: https://bugs.openttd.org/task/5877#comment13086

@DorpsGek
Copy link
Member Author

DorpsGek commented May 5, 2014

George wrote:

Also
We need a property - vehicle_is_waiting_on_red_signal
Without it we can't test, it is moving very slow or stands on signal


This comment was imported from FlySpray: https://bugs.openttd.org/task/5877#comment13292

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 9, 2014

frosch wrote:

Reposting patch here, since paste.o.o moved:
Index: src/train_cmd.cpp

 ===================================================================
--- src/train_cmd.cpp	(revision 26355)
+++ src/train_cmd.cpp	(working copy)
 @@ -3185,12 +3185,12 @@
  						if (!HasSignalOnTrackdir(gp.new_tile, ReverseTrackdir(i))) {
  							v->cur_speed = 0;
  							v->subspeed = 0;
-							v->progress = 255 - 100;
+							v->progress = 255; // make sure that every bit of acceleration will hit the signal again, so speed stays 0.
  							if (!_settings_game.pf.reverse_at_signals || ++v->wait_counter < _settings_game.pf.wait_oneway_signal * 20) return false;
  						} else if (HasSignalOnTrackdir(gp.new_tile, i)) {
  							v->cur_speed = 0;
  							v->subspeed = 0;
-							v->progress = 255 - 10;
+							v->progress = 255; // make sure that every bit of acceleration will hit the signal again, so speed stays 0.
  							if (!_settings_game.pf.reverse_at_signals || ++v->wait_counter < _settings_game.pf.wait_twoway_signal * 73) {
  								DiagDirection exitdir = TrackdirToExitdir(i);
  								TileIndex o_tile = TileAddByDiagDir(gp.new_tile, exitdir);


This comment was imported from FlySpray: https://bugs.openttd.org/task/5877#comment13623

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles labels Apr 7, 2018
@TrueBrain TrueBrain added patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay bug Something isn't working and removed bug from FlySpray labels Apr 13, 2018
@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth
Copy link
Contributor

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. Since OpenTTD moved to GitHub, we use pull requests rather than patches, as they are a much more productive workflow.

I'm planning to close this soon (in 7 days), as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun.

If you would like to continue with this patch, the best way would be to move the patch to your own GitHub fork, update it for the current OpenTTD master, and then create a pull request. For more information, please see our CONTRIBUTING.md.

We are also happy to discuss directly on the issue, or in #openttd irc, including help to get this into a pull request. Thanks for your contribution!

andythenorth added a commit to andythenorth/OpenTTD that referenced this issue Jan 5, 2019
@andythenorth andythenorth removed the stale Stale issues label Jan 6, 2019
planetmaker pushed a commit that referenced this issue Jan 9, 2019
@andythenorth
Copy link
Contributor

Done. Thanks all!

nielsmh pushed a commit to nielsmh/OpenTTD that referenced this issue Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

4 participants