(svn r18647) -Fix: [YAPP] A train inside a station was not always found when checking for trains on a reserved path.

This commit is contained in:
michi_cc
2009-12-27 14:37:50 +00:00
parent 182b0b5c14
commit f7025612e1
3 changed files with 19 additions and 5 deletions

View File

@@ -2872,14 +2872,14 @@ bool TryPathReserve(Train *v, bool mark_as_stuck, bool first_tile_okay)
}
}
bool other_train = false;
Vehicle *other_train = NULL;
PBSTileInfo origin = FollowTrainReservation(v, &other_train);
/* The path we are driving on is alread blocked by some other train.
* This can only happen in certain situations when mixing path and
* block signals or when changing tracks and/or signals.
* Exit here as doing any further reservations will probably just
* make matters worse. */
if (other_train && v->tile != origin.tile) {
if (other_train != NULL && other_train->index != v->index) {
if (mark_as_stuck) MarkTrainAsStuck(v);
return false;
}