From aee7802d483578215e30095028e64c13c70ae473 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 18 Apr 2020 01:06:27 +0100 Subject: [PATCH] Reduced tunnel width --- world/src/site/dungeon/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/world/src/site/dungeon/mod.rs b/world/src/site/dungeon/mod.rs index ca2b3ecebf..2cf98f3857 100644 --- a/world/src/site/dungeon/mod.rs +++ b/world/src/site/dungeon/mod.rs @@ -428,12 +428,12 @@ impl Floor { .map(|nearest| (nearest.distance_squared(rpos) as f32).sqrt()) .unwrap_or(TILE_SIZE as f32); let tunnel_dist = - 1.0 - (dist_to_wall.powf(2.0) - wall_thickness).max(0.0).sqrt() / TILE_SIZE as f32; + 1.0 - (dist_to_wall - wall_thickness).max(0.0) / (TILE_SIZE as f32 - wall_thickness); move |z| match self.tiles.get(tile_pos) { Some(Tile::Solid) => BlockMask::nothing(), Some(Tile::Tunnel) => { - if (z as f32) < 8.0 - 8.0 * tunnel_dist.powf(4.0) { + if dist_to_wall < wall_thickness && (z as f32) < 8.0 - 8.0 * tunnel_dist.powf(4.0) { empty } else { BlockMask::nothing()