From d76e39960aa76e4f879e637e31bcd35b4e2ae1d8 Mon Sep 17 00:00:00 2001 From: r4v3n6101 Date: Wed, 16 Oct 2024 22:07:47 +0300 Subject: [PATCH] fix bug --- Cargo.toml | 2 +- src/parser/texture.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 461d235..31bf4b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "goldsrc-rs" -version = "0.13.2" +version = "0.13.3" authors = ["r4v3n6101 "] edition = "2021" license = "MIT" diff --git a/src/parser/texture.rs b/src/parser/texture.rs index cba19e2..52e9a5b 100644 --- a/src/parser/texture.rs +++ b/src/parser/texture.rs @@ -50,7 +50,7 @@ pub fn miptex(mut reader: R) -> io::Result { for _ in 0..(offsets[0].saturating_sub(40)) { reader.read_u8()?; } - let data_len = (pixels * 4 / 3) as u32 + 2 + 256 * 3; + let data_len = ((pixels * 85) >> 6) as u32 + 2 + 256 * 3; let mut cursor = Cursor::new(vec![0; data_len as usize]); reader.read_exact(cursor.get_mut())?;