fix order

This commit is contained in:
griffi-gh 2023-02-18 00:38:09 +01:00
parent 9268a293a8
commit b7ec1d1165

View file

@ -119,18 +119,21 @@ pub fn generate_world(chunk_position: IVec3, seed: u64) -> (BlockData, Vec<Queue
let height = { let height = {
let local_elevation = raw_elevation_value.powi(4).sqrt(); let local_elevation = raw_elevation_value.powi(4).sqrt();
let mut height = (mountain_ramp(raw_heightmap_value) * local_elevation * 100.) as i32; let mut height = (mountain_ramp(raw_heightmap_value) * local_elevation * 100.) as i32;
//Flatten valleys
if height < 0 {
height /= 2;
}
//Generate rivers //Generate rivers
{ {
let river_value = river_noise.get_noise(noise_x, noise_y); let river_value = river_noise.get_noise(noise_x, noise_y);
if (-0.00625..0.00625).contains(&(river_value.powi(2))) { if (-0.00625..0.00625).contains(&(river_value.powi(2))) {
is_surface = false; is_surface = false;
river_fill_height = Some(height); river_fill_height = Some(height);
height -= (20. * (0.00625 - river_value.powi(2)) * (1. / 0.00625)).round() as i32; height -= (15. * (0.00625 - river_value.powi(2)) * (1. / 0.00625)).round() as i32;
} }
} }
if height < 0 {
height /= 2; //Flatten valleys
//Generate ravines //Generate ravines
if height < 0 {
if raw_ravine_location_value > 0.4 { if raw_ravine_location_value > 0.4 {
let raw_ravine_value = ravine_nose_line.get_noise(noise_x, noise_y); let raw_ravine_value = ravine_nose_line.get_noise(noise_x, noise_y);
if (-0.0125..0.0125).contains(&(raw_ravine_value.powi(2))) { if (-0.0125..0.0125).contains(&(raw_ravine_value.powi(2))) {