summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 3e69da86c..79457b5d2 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -1973,6 +1973,10 @@ int32 CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return 0;
}
+ /* check if at a standstill (not stopped only) in a depot
+ * the check is down here to make it possible to alter stop/service for trains entering the depot */
+ if (IsTileDepotType(v->tile, TRANSPORT_RAIL) && v->cur_speed == 0) return CMD_ERROR;
+
tfdd = FindClosestTrainDepot(v, 0);
if (tfdd.best_length == (uint)-1) return_cmd_error(STR_883A_UNABLE_TO_FIND_ROUTE_TO);