diff --git a/Cargo.lock b/Cargo.lock index 6c5ff11..1022fbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1178,7 +1178,7 @@ dependencies = [ [[package]] name = "tf-log-parser" -version = "0.1.1" +version = "0.1.2" dependencies = [ "ahash", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 257a18a..d020ccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tf-log-parser" -version = "0.1.1" +version = "0.1.2" edition = "2021" rust-version = "1.90.0" description = "TF2 log parser with a focus on speed and flexibility" diff --git a/src/module/kills.rs b/src/module/kills.rs index e4d9313..f219fe7 100644 --- a/src/module/kills.rs +++ b/src/module/kills.rs @@ -174,6 +174,7 @@ impl GlobalData for Kills { RawEventType::Killed | RawEventType::KillAssist | RawEventType::Spawned + | RawEventType::RoleChange | RawEventType::ShotFired | RawEventType::ChargeDeployed | RawEventType::ChargeReady @@ -213,6 +214,14 @@ impl GlobalData for Kills { } self.alive.insert(subject, true); } + GameEvent::RoleChange(event) => { + self.active = self.game_started; + + if let Some(class) = event.class { + self.classes.insert(subject, class); + } + self.alive.insert(subject, true); + } GameEvent::ShotFired(event) => { if let Some(Ok(weapon)) = event.weapon.map(Weapon::from_str) { let class = self.classes.get(&subject).copied().unwrap_or_default();