summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 5bdef09a7..c3eb8c1fa 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -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);