File diff r19880:f49270efec92 → r19881:7d0432d79337
src/elrail.cpp
Show inline comments
 
@@ -314,24 +314,27 @@ static void DrawCatenaryRailway(const Ti
 
		};
 
		SpriteID pylon_base = (halftile_corner != CORNER_INVALID && HasBit(edge_corners[i], halftile_corner)) ? pylon_halftile : pylon_normal;
 
		TileIndex neighbour = ti->tile + TileOffsByDiagDir(i);
 
		int elevation = GetPCPElevation(ti->tile, i);
 

	
 
		/* Here's one of the main headaches. GetTileSlope does not correct for possibly
 
		 * existing foundataions, so we do have to do that manually later on.*/
 
		tileh[TS_NEIGHBOUR] = GetTileSlope(neighbour);
 
		trackconfig[TS_NEIGHBOUR] = GetRailTrackBitsUniversal(neighbour, NULL);
 
		wireconfig[TS_NEIGHBOUR] = MaskWireBits(neighbour, trackconfig[TS_NEIGHBOUR]);
 
		if (IsTunnelTile(neighbour) && i != GetTunnelBridgeDirection(neighbour)) wireconfig[TS_NEIGHBOUR] = trackconfig[TS_NEIGHBOUR] = TRACK_BIT_NONE;
 

	
 
		/* Ignore station tiles that allow neither wires nor pylons. */
 
		if (IsRailStationTile(neighbour) && !CanStationTileHavePylons(neighbour) && !CanStationTileHaveWires(neighbour)) wireconfig[TS_NEIGHBOUR] = trackconfig[TS_NEIGHBOUR] = TRACK_BIT_NONE;
 

	
 
		/* If the neighboured tile does not smoothly connect to the current tile (because of a foundation),
 
		 * we have to draw all pillars on the current tile. */
 
		if (elevation != GetPCPElevation(neighbour, ReverseDiagDir(i))) wireconfig[TS_NEIGHBOUR] = trackconfig[TS_NEIGHBOUR] = TRACK_BIT_NONE;
 

	
 
		isflat[TS_NEIGHBOUR] = ((trackconfig[TS_NEIGHBOUR] & (TRACK_BIT_HORZ | TRACK_BIT_VERT)) != 0);
 

	
 
		PPPpreferred[i] = 0xFF; // We start with preferring everything (end-of-line in any direction)
 
		PPPallowed[i] = AllowedPPPonPCP[i];
 

	
 
		/* We cycle through all the existing tracks at a PCP and see what
 
		 * PPPs we want to have, or may not have at all */
 
		for (uint k = 0; k < NUM_TRACKS_AT_PCP; k++) {