(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.

This commit is contained in:
frosch 2013-02-10 21:05:24 +00:00
parent 86c9cb9b8a
commit 8e8d484558

View File

@ -33,8 +33,7 @@ void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p
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;
}