mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-11-30 12:50:49 +01:00
fix classes in older log without spawn events
This commit is contained in:
parent
dbc24e2578
commit
f5121a75c3
3 changed files with 11 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1178,7 +1178,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tf-log-parser"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"chrono",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue