Fix #12388: Vehicle::CopyVehicleConfigAndStatistics not releasing unit number (#12389)

This commit is contained in:
Jonathan G Rennison
2024-03-27 20:20:27 +00:00
committed by GitHub
parent b8b01818ca
commit 433484cda3
3 changed files with 13 additions and 2 deletions

View File

@@ -1336,8 +1336,7 @@ CommandCost CmdMoveRailVehicle(DoCommandFlag flags, VehicleID src_veh, VehicleID
}
/* Remove stuff not valid anymore for non-front engines. */
DeleteVehicleOrders(src);
Company::Get(src->owner)->freeunits[src->type].ReleaseID(src->unitnumber);
src->unitnumber = 0;
src->ReleaseUnitNumber();
src->name.clear();
}