mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
don't store baseline in baseline
This commit is contained in:
parent
d36a5516e5
commit
626544b07e
3 changed files with 5 additions and 4 deletions
|
|
@ -183,7 +183,7 @@ fn test_bit_var_roundtrip() {
|
|||
}
|
||||
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, Default)]
|
||||
pub struct PacketEntitiesMessage {
|
||||
pub entities: Vec<PacketEntity>,
|
||||
pub removed_entities: Vec<EntityId>,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use crate::{Parse, ParserState, ReadResult, Result, Stream};
|
|||
use tracing::{event, span, Level};
|
||||
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, BitRead, BitWrite, PartialEq, Serialize, Deserialize, Clone)]
|
||||
#[derive(Debug, BitRead, BitWrite, PartialEq, Serialize, Deserialize, Clone, Default)]
|
||||
pub struct MessagePacketMeta {
|
||||
pub flags: u32, // TODO
|
||||
pub view_angles: ViewAngles,
|
||||
|
|
@ -17,7 +17,7 @@ pub struct MessagePacketMeta {
|
|||
}
|
||||
|
||||
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
|
||||
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone, Default)]
|
||||
#[serde(bound(deserialize = "'a: 'static"))]
|
||||
pub struct MessagePacket<'a> {
|
||||
pub tick: u32,
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ impl<'a> ParserState {
|
|||
|
||||
for entity in ent_message.entities {
|
||||
if entity.update_type == UpdateType::Enter {
|
||||
let updated_baseline = match self.instance_baselines[old_index]
|
||||
let mut updated_baseline = match self.instance_baselines[old_index]
|
||||
.get(&entity.entity_index)
|
||||
{
|
||||
Some(baseline_entity)
|
||||
|
|
@ -248,6 +248,7 @@ impl<'a> ParserState {
|
|||
}
|
||||
_ => entity,
|
||||
};
|
||||
updated_baseline.baseline_props = Vec::new();
|
||||
self.instance_baselines[new_index]
|
||||
.insert(updated_baseline.entity_index, updated_baseline);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue