Changeset - r3759:de1f3e0c14e5
[Not reviewed]
master
0 1 0
tron - 19 years ago 2006-05-06 14:32:16
tron@openttd.org
(svn r4750) -Fix: Trains could enter certain sloped rail tiles under bridges with incompatible rail type
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -2624,15 +2624,15 @@ static bool CheckCompatibleRail(const Ve
 
		case MP_TUNNELBRIDGE:
 
			if (IsBridge(tile) && IsBridgeMiddle(tile)) {
 
				uint height;
 
				Slope tileh = GetTileSlope(tile, &height);
 

	
 
				// correct Z position of a train going under a bridge on slopes
 
				if (CorrectZ(tileh)) height += TILE_HEIGHT;
 

	
 
				if (v->z_pos != height) return true; // train is going over bridge
 
				if (tileh != SLOPE_FLAT) height += TILE_HEIGHT;
 

	
 
				if (v->z_pos > height) return true; // train is going over bridge
 
			}
 
			break;
 

	
 
		case MP_STREET:
 
			// tracks over roads, do owner check of tracks
 
			return
0 comments (0 inline, 0 general)