mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix the *actual* crash
This commit is contained in:
parent
f759fd5059
commit
47a909e94d
@ -672,10 +672,12 @@ impl Block {
|
|||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn from_u32(x: u32) -> Option<Self> {
|
pub fn from_u32(x: u32) -> Option<Self> {
|
||||||
let [bk, r, g, b] = x.to_le_bytes();
|
let [bk, r, g, b] = x.to_le_bytes();
|
||||||
Some(Self {
|
let block = Self {
|
||||||
kind: BlockKind::from_u8(bk)?,
|
kind: BlockKind::from_u8(bk)?,
|
||||||
data: [r, g, b],
|
data: [r, g, b],
|
||||||
})
|
};
|
||||||
|
|
||||||
|
(block.kind.is_filled() || SpriteKind::from_block(block).is_some()).then_some(block)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
Loading…
Reference in New Issue
Block a user