1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-05 02:54:10 +02:00

better skips

This commit is contained in:
Robin Appelman 2020-01-19 14:50:35 +01:00
commit f5504cd682
4 changed files with 25 additions and 27 deletions

View file

@ -297,6 +297,10 @@ impl BitRead<LittleEndian> for SendPropFlags {
// since all 16 bits worth of flags are used there are no invalid flags
Ok(SendPropFlags(BitFlags::from_bits_truncate(stream.read()?)))
}
fn bit_size() -> Option<usize> {
Some(16)
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@ -400,7 +404,6 @@ impl SendPropValue {
.map(|int| int as i64)
} else if definition.flags.contains(SendPropFlag::Unsigned) {
let unsigned: u32 = stream.read_sized(definition.bit_count.unwrap_or(32) as usize)?;
//const MAX: u32 = std::i32::MAX as u32;
Ok(unsigned as i64)
} else {
stream