News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

all trailers removed from convoy in depot when trailer setting is "any"

Started by poppo, August 04, 2026, 02:55:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

poppo

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;
}

}

poppo

I found that we also need to fix depot_frame_t::image_from_convoi_list()