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

smaller baselines

This commit is contained in:
Robin Appelman 2022-04-22 20:47:33 +02:00
commit 64b66a770c
3 changed files with 76 additions and 15 deletions

View file

@ -44,6 +44,18 @@ impl From<EntityId> for u32 {
}
}
impl From<usize> for EntityId {
fn from(num: usize) -> Self {
EntityId(num as u32)
}
}
impl From<EntityId> for usize {
fn from(id: EntityId) -> Self {
id.0 as usize
}
}
impl PartialEq<u32> for EntityId {
fn eq(&self, other: &u32) -> bool {
self.0 == *other

View file

@ -68,7 +68,7 @@ impl Parse<'_> for TempEntitiesMessage {
.ok_or(ParseError::UnknownServerClass(class_id))?;
let mut props = Vec::new();
PacketEntitiesMessage::read_update(stream, send_table, &mut props, 0.into())?;
PacketEntitiesMessage::read_update(stream, send_table, &mut props, 0u32.into())?;
events.push(EventInfo {
class_id,