mirror of https://github.com/OpenTTD/OpenTTD
Change: Preserve orders and related settings where possible when moving engines around in a train.
parent
07449be876
commit
7e906c7c59
|
@ -1322,8 +1322,14 @@ CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID
|
||||||
DeleteNewGRFInspectWindow(GSF_TRAINS, src->index);
|
DeleteNewGRFInspectWindow(GSF_TRAINS, src->index);
|
||||||
SetWindowDirty(WC_COMPANY, _current_company);
|
SetWindowDirty(WC_COMPANY, _current_company);
|
||||||
|
|
||||||
/* Delete orders, group stuff and the unit number as we're not the
|
if (src_head != nullptr && src_head->IsFrontEngine()) {
|
||||||
* front of any vehicle anymore. */
|
/* 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);
|
DeleteVehicleOrders(src);
|
||||||
src->unitnumber = 0;
|
src->unitnumber = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue