James,
In the following part of code from haltestelle_t::find_route(ziel_list, ware, journey_time) :
Quote
// Now, find the best route from here.
ITERATE_PTR(ziel_list,i)
{
path test_path = get_path_to(ziel_list->get_element(i), ware.get_besch()->get_catg_index());
if(test_path.journey_time != 65535 && test_path.next_transfer.is_bound())
{
journey_time = test_path.journey_time;
best_destination = i;
}
}
While you have checked the validity of test_path, you have forgotten to compare
test_path.journey_time < journey_time. Without this check, journey_time and best_destination will always store the values for the last valid test_path, which may not necessary be the best path.
Aha, well-spotted, thank you! Will be in 3.9.