summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 5fbd2278f..d2c64bc0a 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -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;
}