|
|
|
@ -1322,8 +1322,14 @@ CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID
|
|
|
|
|
DeleteNewGRFInspectWindow(GSF_TRAINS, src->index);
|
|
|
|
|
SetWindowDirty(WC_COMPANY, _current_company);
|
|
|
|
|
|
|
|
|
|
/* Delete orders, group stuff and the unit number as we're not the
|
|
|
|
|
* front of any vehicle anymore. */
|
|
|
|
|
if (src_head != nullptr && src_head->IsFrontEngine()) {
|
|
|
|
|
/* Cases #?b: Transfer order, unit number and other stuff
|
|
|
|
|
* to the new front engine. */
|
|
|
|
|
src_head->orders = src->orders;
|
|
|
|
|
if (src_head->orders != nullptr) src_head->AddToShared(src);
|
|
|
|
|
src_head->CopyVehicleConfigAndStatistics(src);
|
|
|
|
|
}
|
|
|
|
|
/* Remove stuff not valid anymore for non-front engines. */
|
|
|
|
|
DeleteVehicleOrders(src);
|
|
|
|
|
src->unitnumber = 0;
|
|
|
|
|
}
|
|
|
|
|