The International Simutrans Forum

Simutrans Extended => Simutrans-Extended bug reports => Simutrans-Extended development => Simutrans-Extended closed bug reports => Topic started by: RESTRICTED ACCOUNT on June 01, 2021, 11:10:02 AM

Title: Go to depot button issues (automatic cancellation, etc.)
Post by: RESTRICTED ACCOUNT on June 01, 2021, 11:10:02 AM
The behavior regarding go to depot button has been broken for a long time with Extended.
It already existed in Extended 12.3 as far as I can confirm.

(A) Deceive us with the message "sent to depot" while refusing to go to the depot in some case
(B) Originally the button "Go to the depot" should be pressed if the convoy is heading to the depot
(C) "Destination:" display must be depot if heading to depot


At first I thought this was a UI-only issue and thought it could be easily fixed, so I tried to fix it, but it seems to be a bug lurking somewhere in the convoi sequence of code and is currently I couldn't find a solution.

This is caused by the selected schedule number being incremented or decremented for some reason.
As a result, the next stop display and the pressed "Go to depot" button are not working properly.


How to reliably reproduce (A):
(1) Open demo save
(2) Press the "Go to depot" button while the convoy belonging to "Tram Line 1" is heading from "High streey" to "Bridge Street"
(3) At first glance, the convoy looks like it's heading to the depot, but cancels before the depot and runs the original schedule.

Confirmation procedure of (B) and (C):
(1) Pause the game and press the Go to depot button on the convoy info dialog
(2) You can see that the destination is depot and the go to depot button is pressed
(3) Unpause the game
(4) Immediately after those displays will be incorrect
Title: PR#497 - FIX: convoy refuses to return to the depot
Post by: RESTRICTED ACCOUNT on February 13, 2022, 09:52:28 PM
I think I have fixed this bug. Please check the pull request #497.

This bug had a pattern where the destination display was not depot, but went to depot correctly, and a pattern where it did not actually go to depot (somehow the schedule gets rewritten on the way into the depot).
Anyway, it seems that normalizing the selected schedule will fix both cases.

This may also solve the problem of replacing not functioning properly in some cases.
Title: Re: Go to depot button issues (automatic cancellation, etc.)
Post by: jamespetts on February 17, 2022, 12:37:27 AM
Thank you for this - now incorporated.