pathfind.c
changeset 5708 76382881636e
parent 5707 73fc8891bebc
equal deleted inserted replaced
5707:73fc8891bebc 5708:76382881636e
   297 		// road stops and depots now have a track (r4419)
   297 		// road stops and depots now have a track (r4419)
   298 		// don't enter road stop from the back
   298 		// don't enter road stop from the back
   299 		if (IsRoadStopTile(tile) && ReverseDiagDir(GetRoadStopDir(tile)) != direction) return;
   299 		if (IsRoadStopTile(tile) && ReverseDiagDir(GetRoadStopDir(tile)) != direction) return;
   300 		// don't enter road depot from the back
   300 		// don't enter road depot from the back
   301 		if (IsTileDepotType(tile, TRANSPORT_ROAD) && ReverseDiagDir(GetRoadDepotDirection(tile)) != direction) return;
   301 		if (IsTileDepotType(tile, TRANSPORT_ROAD) && ReverseDiagDir(GetRoadDepotDirection(tile)) != direction) return;
       
   302 	}
       
   303 
       
   304 	/* Check if the new tile is a tunnel or bridge head and that the direction
       
   305 	 * and transport type match */
       
   306 	if (IsTileType(tile, MP_TUNNELBRIDGE)) {
       
   307 		if (IsTunnel(tile)) {
       
   308 			if (GetTunnelDirection(tile) != direction ||
       
   309 					GetTunnelTransportType(tile) != tpf->tracktype) {
       
   310 				return;
       
   311 			}
       
   312 		} else if (IsBridge(tile)) {
       
   313 			if (GetBridgeRampDirection(tile) != direction ||
       
   314 					GetBridgeTransportType(tile) != tpf->tracktype) {
       
   315 				return;
       
   316 			}
       
   317 		}
   302 	}
   318 	}
   303 
   319 
   304 	tpf->rd.cur_length++;
   320 	tpf->rd.cur_length++;
   305 
   321 
   306 	bits = GetTileTrackStatus(tile, tpf->tracktype);
   322 	bits = GetTileTrackStatus(tile, tpf->tracktype);