The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: poppo on September 24, 2025, 08:45:53 AM

Title: pre-signal cannot check is_choose_signal_clear()
Post by: poppo on September 24, 2025, 08:45:53 AM
In rail_vehicle_t::is_choose_signal_clear(), the richtung used in route_t::find_route() is defined as
const int richtung = ribi_type(get_pos(), pos_next);in vehicle/rail_vehicle.cc, l438.
But, if the next signal of pre-signal is choose-signal, this ribi can be wrong and route_t::find_route() does not work well, because this vehicle is not on the tile with choose-signal.
So, I think it should be
const int richtung = ribi_type(cnv->get_route()->at(start_block),cnv->get_route()->at(start_block+1));then, pre-signal can always check next choose-signal.
Title: Re: pre-signal cannot check is_choose_signal_clear()
Post by: prissi on September 24, 2025, 01:15:04 PM
If I use the suggested code, the curved choossignal stopped working in my tests, it only works with the code as it is.
Title: Re: pre-signal cannot check is_choose_signal_clear()
Post by: poppo on September 24, 2025, 03:09:05 PM
really!? but my code does work well in my environment.
I send patch and image during debugging.
Title: Re: pre-signal cannot check is_choose_signal_clear()
Post by: prissi on September 25, 2025, 12:43:44 PM
Today it works. Not sure what happened Yesterday. However, my testcase also worked with the old code, as long as it was not backwards. Anyway, thanks for finding this well-hidden bug. Sumitted in r11761