Fix #10975: Clear a non-head engine's name (#10976)

(cherry picked from commit 1be668c2e4)
This commit is contained in:
merni-ns
2023-06-09 20:39:36 +05:30
committed by Jonathan G Rennison
parent 2618179664
commit e1cb4d2397

View File

@@ -2216,6 +2216,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
/* Remove stuff not valid anymore for non-front engines. */
DeleteVehicleOrders(src);
src->unitnumber = 0;
src->name.clear();
if (HasBit(src->vehicle_flags, VF_HAVE_SLOT)) {
TraceRestrictRemoveVehicleFromAllSlots(src->index);
ClrBit(src->vehicle_flags, VF_HAVE_SLOT);