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

Comments

Projects
None yet
4 participants
@DorpsGek
Copy link

commented Jan 25, 2014

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

This comment has been minimized.

Copy link
Author

commented Feb 19, 2014

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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
@andythenorth

This comment has been minimized.

Copy link
Contributor

commented Jan 5, 2019

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 label Jan 6, 2019

planetmaker added a commit that referenced this issue Jan 9, 2019

@andythenorth

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2019

Done. Thanks all!

nielsmh added 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
You can’t perform that action at this time.