The International Simutrans Forum

Development => Bug Reports => Topic started by: poppo on August 04, 2026, 02:55:43 AM

Title: all trailers removed from convoy in depot when trailer setting is "any"
Post by: poppo on August 04, 2026, 02:55:43 AM
In tool_change_depot_t's case 'r' or 'R', searching the removable vehicles from convoy with using get_trailer_count().
But, when trailer setting is "any", which can couple not only one vehicle but almost all vehicles, trailer count is 1 and remove this vehicle from convoy.

Before
//bool tool_change_depot_t::init()
// find end
while(nr<cnv->get_vehicle_count()) {
const vehicle_desc_t *info = cnv->get_vehicle(nr)->get_desc();
nr ++;
if(info->get_trailer_count()!=1) {
break;
}

After
// find end
while(nr<cnv->get_vehicle_count()) {
const vehicle_desc_t *info = cnv->get_vehikel(nr)->get_desc();
nr ++;
if(info->get_trailer_count()==1) {
vehicle_desc_t const* const veh = info->get_trailer(0);
// the leading is any, we should keep it.
if(  veh!=vehicle_desc_t::any_vehicle  ) {
break;
}
}
else {
break;
}

}
Title: Re: all trailers removed from convoy in depot when trailer setting is "any"
Post by: poppo on August 06, 2026, 08:01:44 PM
I found that we also need to fix depot_frame_t::image_from_convoi_list()