From 47a909e94ddb13866e1aca58d2944b33fa28b454 Mon Sep 17 00:00:00 2001 From: Maxicarlos08 Date: Fri, 26 Jan 2024 02:15:14 +0100 Subject: [PATCH] fix the *actual* crash --- common/src/terrain/block.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index e04c195396..1160c6877e 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -672,10 +672,12 @@ impl Block { #[must_use] pub fn from_u32(x: u32) -> Option { let [bk, r, g, b] = x.to_le_bytes(); - Some(Self { + let block = Self { kind: BlockKind::from_u8(bk)?, data: [r, g, b], - }) + }; + + (block.kind.is_filled() || SpriteKind::from_block(block).is_some()).then_some(block) } #[inline]