From 8a347c097860694c1d790fab8d2f84590de6b5a8 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Fri, 14 May 2021 19:10:17 -0400 Subject: [PATCH] Make the chunks above dungeons/caves default to black when the ceiling is below them. --- voxygen/src/hud/minimap.rs | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index b095b96d71..6932b324fc 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -301,19 +301,23 @@ impl VoxelMinimap { above, below, }| { - layers - .get( - ((pos.z as i32 - zlo + ceiling_offset) as usize) - .min(layers.len().saturating_sub(1)), - ) - .and_then(|grid| grid.get(cmod).map(|c| c.0.as_())) - .or_else(|| { - Some(if pos.z as i32 > *zlo { - above.0 - } else { - below.0 + if pos.z as i32 + ceiling_offset < *zlo { + Some(Vec3::zero().with_w(255)) + } else { + layers + .get( + ((pos.z as i32 - zlo + ceiling_offset) as usize) + .min(layers.len().saturating_sub(1)), + ) + .and_then(|grid| grid.get(cmod).map(|c| c.0.as_())) + .or_else(|| { + Some(if pos.z as i32 > *zlo { + above.0 + } else { + below.0 + }) }) - }) + } }, ) .unwrap_or_else(Vec4::zero);