(svn r12188) -Codechange [FS#1782]: do not check twice for correct rail owner (patch by Vikthor)
authorsmatz
Wed, 20 Feb 2008 11:00:17 +0000
changeset 9102 238c3c97c249
parent 9101 cd8280bf595c
child 9103 ef4a10ed7f9f
(svn r12188) -Codechange [FS#1782]: do not check twice for correct rail owner (patch by Vikthor)
src/train_cmd.cpp
--- a/src/train_cmd.cpp	Tue Feb 19 17:52:30 2008 +0000
+++ b/src/train_cmd.cpp	Wed Feb 20 11:00:17 2008 +0000
@@ -3437,9 +3437,9 @@
 	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 @@
 		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);
 	}