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

dont remove first user

This commit is contained in:
Robin Appelman 2019-03-05 00:06:17 +01:00
commit a26e29292e

View file

@ -256,14 +256,14 @@ impl Analyser {
let name: String = data.read_sized(32)?;
let user_id = UserId((data.read::<u32>()? & 255) as u8);
let steam_id: String = data.read()?;
let entity_id: u32 = text.parse().unwrap_or_default();
let entity_id: Option<u32> = text.parse().ok();
if entity_id > 0 && steam_id.len() > 0 {
if entity_id.is_some() && steam_id.len() > 0 {
let user = UserInfo {
steam_id,
user_id,
name,
entity_id: EntityId::new(entity_id),
entity_id: EntityId::new(entity_id.unwrap()),
};
self.users.insert(user_id, user);