summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-20 11:00:17 +0000
committersmatz <smatz@openttd.org>2008-02-20 11:00:17 +0000
commit595d9357c35267245d733d741a8deacce0660b59 (patch)
tree7d80507b1465e961aa51dffe052fa5a21aeb8a51
parentb4b5c09ff91fef06dfa26d9f7182e5efa32f1ef5 (diff)
downloadopenttd-595d9357c35267245d733d741a8deacce0660b59.tar.xz
(svn r12188) -Codechange [FS#1782]: do not check twice for correct rail owner (patch by Vikthor)
-rw-r--r--src/train_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index e4f0a6bf5..9a9f0a2f7 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3437,9 +3437,9 @@ static TileIndex TrainApproachingCrossingTile(const Vehicle *v)
DiagDirection dir = TrainExitDir(v->direction, v->u.rail.track);
TileIndex tile = v->tile + TileOffsByDiagDir(dir);
- /* not a crossing || wrong axis || wrong railtype || wrong owner */
+ /* not a crossing || wrong axis || unusable rail (wrong type or owner) */
if (!IsLevelCrossingTile(tile) || DiagDirToAxis(dir) == GetCrossingRoadAxis(tile) ||
- !CheckCompatibleRail(v, tile) || GetTileOwner(tile) != v->owner) {
+ !CheckCompatibleRail(v, tile)) {
return INVALID_TILE;
}
@@ -3485,8 +3485,8 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
bits &= ~TrackCrossesTracks(FindFirstTrack(v->u.rail.track));
}
- /* no suitable trackbits at all || wrong railtype || not our track */
- if (bits == TRACK_BIT_NONE || !CheckCompatibleRail(v, tile) || GetTileOwner(tile) != v->owner) {
+ /* no suitable trackbits at all || unusable rail (wrong type or owner) */
+ if (bits == TRACK_BIT_NONE || !CheckCompatibleRail(v, tile)) {
return TrainApproachingLineEnd(v, false);
}