train_cmd.c
changeset 4526 77ef74d28e76
parent 4519 1437b1e7416c
child 4527 b18634a31a4a
--- a/train_cmd.c	Sat Sep 02 21:52:06 2006 +0000
+++ b/train_cmd.c	Sat Sep 02 22:47:45 2006 +0000
@@ -1973,6 +1973,10 @@
 		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);