mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 10:14:06 +02:00
minor cleanup
This commit is contained in:
parent
8442c5e385
commit
94e83c187e
1 changed files with 14 additions and 10 deletions
|
|
@ -271,18 +271,22 @@ impl Analyser {
|
|||
let name: String = data.read_sized(32).unwrap_or("Malformed Name".into());
|
||||
let user_id = UserId((data.read::<u32>()? & 255) as u8);
|
||||
let steam_id: String = data.read()?;
|
||||
let entity_id: Option<u32> = text.parse().ok();
|
||||
|
||||
if entity_id.is_some() && steam_id.len() > 0 {
|
||||
let user = UserInfo {
|
||||
match text.parse() {
|
||||
Ok(entity_id) if (steam_id.len() > 0) => {
|
||||
self.users.insert(
|
||||
user_id,
|
||||
UserInfo {
|
||||
steam_id,
|
||||
user_id,
|
||||
name,
|
||||
entity_id: EntityId::new(entity_id.unwrap()),
|
||||
};
|
||||
|
||||
self.users.insert(user_id, user);
|
||||
entity_id: EntityId::new(entity_id),
|
||||
},
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue