changeset 20054:b4d32dc27cfe draft

(svn r24987) -Fix: When choosing a train in a depot to attach a newly purchased wagon to, do not consider trains currently moving in and out of the depot.
author frosch <frosch@openttd.org>
date Sun, 10 Feb 2013 21:05:24 +0000
parents d49381b79636
children b6e2c632c612
files src/train_gui.cpp
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -33,8 +33,7 @@
 	const Vehicle *found = NULL;
 	const Train *t;
 	FOR_ALL_TRAINS(t) {
-		if (t->IsFrontEngine() && t->tile == tile &&
-				t->track == TRACK_BIT_DEPOT) {
+		if (t->IsFrontEngine() && t->tile == tile && t->IsStoppedInDepot()) {
 			if (found != NULL) return; // must be exactly one.
 			found = t;
 		}