OpenTTD

Tasklist

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

Attached to Project: OpenTTD
Opened by David Dallaston (Pikka) - Saturday, 25 January 2014, 12:11 GMT
Last edited by frosch (frosch) - Wednesday, 05 March 2014, 21:15 GMT
Type Bug
Category Vehicles
Status Assigned
Assigned To frosch (frosch)
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

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.
This task depends upon

Comment by frosch (frosch) - Wednesday, 19 February 2014, 21:49 GMT
Potential fix, but maybe there is a better one:
http://paste.openttdcoop.org/show/3117/
Comment by George (George) - Monday, 05 May 2014, 18:52 GMT
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
Comment by frosch (frosch) - Sunday, 09 November 2014, 13:29 GMT
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);

Loading...