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

improved user info handling

This commit is contained in:
Robin Appelman 2020-02-09 16:38:38 +01:00
commit 1eb6c06ac3
7 changed files with 14 additions and 11 deletions

View file

@ -359,17 +359,20 @@ impl Analyser {
.unwrap_or_else(|| Ok((user_id.0 as u32).into()))
{
Ok(entity_id) if !steam_id.is_empty() => {
self.state.users.insert(
user_id,
UserInfo {
self.state
.users
.entry(user_id)
.and_modify(|info| {
info.entity_id = entity_id;
})
.or_insert_with(|| UserInfo {
classes: ClassList::default(),
team: Team::Other,
steam_id,
user_id,
name,
entity_id,
},
);
});
}
_ => {}
}