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 never finishes entering depot, blocks itself from leaving depot. #8981

Closed
alexander-novo opened this issue Apr 9, 2021 · 7 comments
Closed
Labels
needs triage This issue needs further investigation before it becomes actionable

Comments

@alexander-novo
Copy link

alexander-novo commented Apr 9, 2021

Version of OpenTTD

1.11.0

Expected result

Train finishes entering depot before trying to leave.

Actual result

Train tries to leave depot, but it still has cars outside the depot which are claiming the rails into the depot, so it cannot leave and therefore doesn't move the cars going into the depot.

Steps to reproduce

EDIT: see repro steps below.

I'm not certain exactly how to reproduce, but it happened when I added a one way path signal going into the depot (shown in the center of the screen) and changed the direction of the signal while the train was on top of it going into the depot. It then stopped and produced the above loop.

Brafingfield Transport, 1982-11-06

I can't sell the train in the depot, it says "must be stopped inside a depot".

Save file (zipped):

Brafingfield Transport, 1983-01-02.zip

@nielsmh
Copy link
Contributor

nielsmh commented Apr 9, 2021

Please attach your savegame too, assuming the problem persists over a save and load.

@alexander-novo
Copy link
Author

I attached my save to the original post. Unfortunately, I have AIs in the game, but I wouldn't guess that they would be the ones producing the issue? It seems to persist through loading.

@nielsmh
Copy link
Contributor

nielsmh commented Apr 9, 2021

At least you can resolve the situation by clicking the "ignore signals" button on the train, it continues into the depot then. Still, it's weird how this has happened, I'll try to examine that a bit more.

@alexander-novo
Copy link
Author

Thanks for that tip! I had written off the save file, so it's nice to know I can continue.

@alexander-novo
Copy link
Author

Also, I was able to replicate it a second time: when placing a one-way path signal on top of a train which is entering a depot and the default placement is in the opposite direction that the train is going, it will cause the bug.

@LC-Zorg
Copy link

LC-Zorg commented Apr 9, 2021

This always happens when you put a pathsignal over a train that enters the depot - it is very repetitive.

Steps to reproduce

  • build tracks to the depot
  • put block or pre signals on it
  • send a train to the depot
  • when the train entering to depot, put a pathsignal (any direction) in front of this depot - the train will stop

It may not be a good idea to ignore the signal. It is better to change the direction of the train twice.

@TrueBrain TrueBrain added the needs triage This issue needs further investigation before it becomes actionable label Apr 10, 2021
@PeterN
Copy link
Member

PeterN commented Apr 10, 2021

Something about freeing the track reservation looks suspect, especially this comment on line 2252 of train_cmd.cpp:

/* Can't be holding a reservation if we enter a depot. */

I think it's simply not freeing the reservation, and thus fails when trying to reverse it again after the signal is placed.

EDIT: That function clears the path in front of the train, so is irrelevant, I think. It does try to reverse the path ahead, but that won't work because the depot is still reserved, so it marks it as stuck.

PeterN added a commit to PeterN/OpenTTD that referenced this issue Apr 10, 2021
PeterN added a commit to PeterN/OpenTTD that referenced this issue Apr 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue needs further investigation before it becomes actionable
Projects
None yet
Development

No branches or pull requests

5 participants