mirror of https://github.com/OpenTTD/OpenTTD
(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.
parent
b1016f66ba
commit
affd456995
|
@ -33,8 +33,7 @@ void CcBuildWagon(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p
|
||||||
const Vehicle *found = NULL;
|
const Vehicle *found = NULL;
|
||||||
const Train *t;
|
const Train *t;
|
||||||
FOR_ALL_TRAINS(t) {
|
FOR_ALL_TRAINS(t) {
|
||||||
if (t->IsFrontEngine() && t->tile == tile &&
|
if (t->IsFrontEngine() && t->tile == tile && t->IsStoppedInDepot()) {
|
||||||
t->track == TRACK_BIT_DEPOT) {
|
|
||||||
if (found != NULL) return; // must be exactly one.
|
if (found != NULL) return; // must be exactly one.
|
||||||
found = t;
|
found = t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue