Waypoints are no longer placed underwater

This commit is contained in:
Synis 2021-02-16 13:23:12 +01:00
parent bf9dbee14a
commit a29ce3c428

View File

@ -1635,6 +1635,10 @@ impl WorldSim {
.filter_map(|(i, j)| { .filter_map(|(i, j)| {
let mut pos = Vec2::new(i as i32, j as i32); let mut pos = Vec2::new(i as i32, j as i32);
let mut chunk = this.get(pos)?; let mut chunk = this.get(pos)?;
if chunk.is_underwater() {
return None;
}
// Slide the waypoints down hills // Slide the waypoints down hills
const MAX_ITERS: usize = 64; const MAX_ITERS: usize = 64;
for _ in 0..MAX_ITERS { for _ in 0..MAX_ITERS {