Merge branch 'master' into jgrpp

# Conflicts:
#	cmake/CompileFlags.cmake
#	src/cargomonitor.cpp
#	src/core/CMakeLists.txt
#	src/economy.cpp
#	src/landscape.cpp
#	src/linkgraph/flowmapper.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/linkgraphschedule.cpp
#	src/misc_gui.cpp
#	src/newgrf_generic.cpp
#	src/newgrf_storage.cpp
#	src/rail_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/station_sl.cpp
#	src/script/script_gui.cpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/string_func.h
#	src/terraform_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2023-06-07 21:28:46 +01:00
129 changed files with 2080 additions and 2061 deletions

View File

@@ -2206,10 +2206,15 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
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);
RemoveVehicleFromGroup(src);
src->unitnumber = 0;
if (HasBit(src->vehicle_flags, VF_HAVE_SLOT)) {
TraceRestrictRemoveVehicleFromAllSlots(src->index);