From b8bbda4be81fd9cdf50b2c584b92a27781d9558c Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sat, 28 Jan 2023 21:34:11 +0100 Subject: [PATCH] better check --- src/world/mesh.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/world/mesh.rs b/src/world/mesh.rs index 69018dc..f991594 100644 --- a/src/world/mesh.rs +++ b/src/world/mesh.rs @@ -1,5 +1,6 @@ use strum::{EnumIter, IntoEnumIterator}; use glam::{Vec3A, vec3a, IVec3, ivec3}; +use std::mem::discriminant; use super::{chunk::CHUNK_SIZE, block::{Block, RenderType}}; use crate::rendering::world::ChunkVertex; @@ -111,7 +112,7 @@ pub fn generate_mesh(data: MeshGenData) -> (Vec, Vec) { for face in CubeFace::iter() { let facing = CUBE_FACE_NORMALS[face as usize].as_ivec3(); let facing_coord = coord + facing; - let show = matches!(get_block(facing_coord).descriptor().render, RenderType::None); + let show = discriminant(&get_block(facing_coord).descriptor().render) != discriminant(&descriptor.render); if show { match descriptor.render { RenderType::SolidBlock(textures) => {