News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

pre-signal cannot check is_choose_signal_clear()

Started by poppo, September 24, 2025, 08:45:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

poppo

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.

prissi

If I use the suggested code, the curved choossignal stopped working in my tests, it only works with the code as it is.

poppo

really!? but my code does work well in my environment.
I send patch and image during debugging.

prissi

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