Skip to main content
Topic: [r2781] Trains clear reservation too early (Read 1862 times) previous topic - next topic

[r2781] Trains clear reservation too early

For some time I have been having troubles with a bug that I have not seen reported here. Sometimes after sending a train to a depot, and then sending it back out, the train clears its track reservation immediately after the first vehicle. This in turn allows other vehicles to p**** straight though the other vehicles. The problem can as far as I can tell only be (temporarily) cured by saving and then loading the game back in again, or by sending the train back to a depot and modify it. Because of this, I see no purpose in attaching a save game.

Interestingly, when I clear the trains reservation manually (b key) it will reserve all tiles under the whole train when re-reserving, but clears all those behind the locomotive immediately when it starts moving. I have not seen this bug affect trains that have been modified while in the depot, nor does it seem to happen all the time, but I might miss some occurrences.

I am running an optimized, non-debug version self-compiled form the svn repository. STEPS16 is defined. Linux, sdl, pak64 (also from svn), gcc 4.1.2, x86-64.

Re: [r2781] Trains clear reservation too early

Reply #1
Well, STEPS=16 us no longer used, and non-debug might create additional bugs, at least it is not recommended but for very small memory devices where every kB counts (SInce it cuts off about 150kB).

Anyway, the describe behaviour means that the cars, that claer the reservation, also have the flag set for the last car. Only cars with this flag can clean the reservation.

EDIT: On entering a depot, the flag was set during removal from track but not resetted, when the convoi was not changed. Added another sanity check to simconvoi_t::start.

Thanky ou for spotting this out.

Re: [r2781] Trains clear reservation too early

Reply #2
If STEPS16 is no longer used, then maybe it should be removed from config.template? And I am running non-debug because I found out the game run smoother then. Another advantage with non-debug builds, is that you can spot those nasty little bugs that only show up then.

Re: [r2781] Trains clear reservation too early

Reply #3
Ok, but the extra error message go even into release builds ...

I will lokk into steps16 and the current makefile tomorrow, to prepare for the stable anyway.