mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
fix sendprop definition encoding
This commit is contained in:
parent
04d22ea2be
commit
a59fee55ca
1 changed files with 5 additions and 1 deletions
|
|
@ -70,6 +70,7 @@ pub struct RawSendPropDefinition {
|
||||||
pub bit_count: Option<u32>,
|
pub bit_count: Option<u32>,
|
||||||
pub element_count: Option<u16>,
|
pub element_count: Option<u16>,
|
||||||
pub array_property: Option<Box<RawSendPropDefinition>>,
|
pub array_property: Option<Box<RawSendPropDefinition>>,
|
||||||
|
original_bit_count: Option<u32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartialEq for RawSendPropDefinition {
|
impl PartialEq for RawSendPropDefinition {
|
||||||
|
|
@ -151,6 +152,7 @@ impl RawSendPropDefinition {
|
||||||
bit_count: self.bit_count,
|
bit_count: self.bit_count,
|
||||||
element_count: self.element_count,
|
element_count: self.element_count,
|
||||||
array_property: Some(Box::new(array_property)),
|
array_property: Some(Box::new(array_property)),
|
||||||
|
original_bit_count: self.original_bit_count,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -186,6 +188,7 @@ impl RawSendPropDefinition {
|
||||||
high_value = Some(stream.read()?);
|
high_value = Some(stream.read()?);
|
||||||
bit_count = Some(stream.read_int(7)?);
|
bit_count = Some(stream.read_int(7)?);
|
||||||
}
|
}
|
||||||
|
let original_bit_count = bit_count;
|
||||||
|
|
||||||
if flags.contains(SendPropFlag::NoScale) {
|
if flags.contains(SendPropFlag::NoScale) {
|
||||||
if prop_type == SendPropType::Float {
|
if prop_type == SendPropType::Float {
|
||||||
|
|
@ -207,6 +210,7 @@ impl RawSendPropDefinition {
|
||||||
high_value,
|
high_value,
|
||||||
bit_count,
|
bit_count,
|
||||||
element_count,
|
element_count,
|
||||||
|
original_bit_count,
|
||||||
array_property: None,
|
array_property: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -237,7 +241,7 @@ impl BitWrite<LittleEndian> for RawSendPropDefinition {
|
||||||
element_count.write_sized(stream, 10)?;
|
element_count.write_sized(stream, 10)?;
|
||||||
}
|
}
|
||||||
if let (Some(low_value), Some(high_value), Some(bit_count)) =
|
if let (Some(low_value), Some(high_value), Some(bit_count)) =
|
||||||
(self.low_value, self.high_value, self.bit_count)
|
(self.low_value, self.high_value, self.original_bit_count)
|
||||||
{
|
{
|
||||||
low_value.write(stream)?;
|
low_value.write(stream)?;
|
||||||
high_value.write(stream)?;
|
high_value.write(stream)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue