src/ai/trolly/pathfinder.cpp
changeset 10229 fba3f9fa44d7
parent 10222 b6919c94cc77
child 10429 1b99254f9607
equal deleted inserted replaced
10228:a9b95e8981d6 10229:fba3f9fa44d7
   340 		// Next, check for tunnels!
   340 		// Next, check for tunnels!
   341 		// Tunnels can only be built on slopes corresponding to the direction
   341 		// Tunnels can only be built on slopes corresponding to the direction
   342 		//  For now, we check both sides for this tile.. terraforming gives fuzzy result
   342 		//  For now, we check both sides for this tile.. terraforming gives fuzzy result
   343 		if (tileh == InclinedSlope(dir)) {
   343 		if (tileh == InclinedSlope(dir)) {
   344 			// Now simply check if a tunnel can be build
   344 			// Now simply check if a tunnel can be build
   345 			ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road?0:0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
   345 			ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road ? 0 : 0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
   346 			tileh = GetTileSlope(_build_tunnel_endtile, NULL);
   346 			tileh = GetTileSlope(_build_tunnel_endtile, NULL);
   347 			if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
   347 			if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
   348 				aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;
   348 				aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;
   349 				aystar->neighbours[aystar->num_neighbours].user_data[0] = AI_PATHFINDER_FLAG_TUNNEL + (dir << 8);
   349 				aystar->neighbours[aystar->num_neighbours].user_data[0] = AI_PATHFINDER_FLAG_TUNNEL + (dir << 8);
   350 				aystar->neighbours[aystar->num_neighbours++].direction = 0;
   350 				aystar->neighbours[aystar->num_neighbours++].direction = 0;