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

Train "force proceed" status gets reset when going near to, but not through signals #5723

Closed
DorpsGek opened this issue Aug 25, 2013 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

adf88 opened the ticket and wrote:

"Force proceed" status gets reset when a train goes through a track without signals, but the tile has signals on the other track. See attached pictures.

The problem is here: http://vcs.openttd.org/svn/browser/trunk/src/train_cmd.cpp?rev=25742# L3140
There is "HasSignals(gp.new_tile)" checking the tile, but there is no check whether the track has any signals on it.

Fix patch attached.

Attachments

Reported version: trunk
Operating system: All


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

adf88 wrote:

Sorry, I uploaded wrong patch file. This is the right one.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5723#comment12564

@DorpsGek
Copy link
Member Author

planetmaker wrote:

Pathfinder code is convoluted at best. We wondered... could it be simplified maybe?
maybe "if (HasSignalOnTrackdir(gp.new_tile, dir))" only? without the weird old condition?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5723#comment12621

@DorpsGek
Copy link
Member Author

adf88 wrote:

HasSignalOnTrack would be ok, this way all types and combinations of signals would be equal, passing back of a PBS would decrease the counter as well as other signals do. Is this what you are suggesting?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5723#comment12625

@DorpsGek
Copy link
Member Author

frosch wrote:

We wondered whether
+ if (HasSignalOnTrackdir(gp.new_tile, dir) ||
+ (HasSignalOnTrackdir(gp.new_tile, ReverseTrackdir(dir)) &&
+ GetSignalType(gp.new_tile, TrackdirToTrack(dir)) != SIGTYPE_PBS)) {
is equivalent to
+ if (HasSignalOnTrackdir(gp.new_tile, dir)) {

I.e. does the ( && ) imply the first condition and is superfluous?


This comment was imported from FlySpray: https://bugs.openttd.org/task/5723#comment12626

@DorpsGek
Copy link
Member Author

adf88 wrote:

With just "if (HasSignalOnTrackdir(gp.new_tile, dir))" trains would pass signals from back without resetting their "force proceed" status. You are not checking the back side at all, it makes no difference whether there is a signal or not. So no, it's not equivalent.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5723#comment12628

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 8, 2013

Rubidium closed the ticket.

Reason for closing: Fixed

In r25955.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5723

@DorpsGek DorpsGek closed this as completed Nov 8, 2013
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant