mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-02 03:19:10 +00:00
(svn r23683) -Fix [FS#4912]-ish: when fitting another engine the cargo capacity of wagons could become lower, causing them to contain more than they should. This caused the cargo transfer from the replaced parts to put even more stuff in the already full wagon. Prevent this from happening by reducing the amount of cargo in the vehicle to the capacity when moving vehicles/wagons around, or when autoreplacing
This commit is contained in:
@@ -1281,6 +1281,11 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||
NormaliseTrainHead(src_head);
|
||||
NormaliseTrainHead(dst_head);
|
||||
|
||||
if ((flags & DC_NO_CARGO_CAP_CHECK) == 0) {
|
||||
CheckCargoCapacity(src_head);
|
||||
CheckCargoCapacity(dst_head);
|
||||
}
|
||||
|
||||
/* We are undoubtedly changing something in the depot and train list. */
|
||||
InvalidateWindowData(WC_VEHICLE_DEPOT, src->tile);
|
||||
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
|
||||
|
Reference in New Issue
Block a user