Changeset - r8606:9f6f09d1d701
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-02-20 11:00:17
smatz@openttd.org
(svn r12188) -Codechange [FS#1782]: do not check twice for correct rail owner (patch by Vikthor)
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -3437,9 +3437,9 @@ static TileIndex TrainApproachingCrossin
 
	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
 
		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);
 
	}
 

	
0 comments (0 inline, 0 general)