Add weapon and some other info to perround

In the events per round, it now dispalys the weapon used and headshot and noscope if applicable.
Otherwise also cleaned up other code
This commit is contained in:
Lol3rrr
2024-11-03 14:47:34 +01:00
parent 7e50a627f6
commit 898a889a53
8 changed files with 80 additions and 28 deletions

View File

@@ -505,7 +505,13 @@ async fn perround(
analysis::perround::RoundEvent::BombDefused => {
common::demo_analysis::RoundEvent::BombDefused
}
analysis::perround::RoundEvent::Kill { attacker, died } => {
analysis::perround::RoundEvent::Kill {
attacker,
died,
weapon,
noscope,
headshot,
} => {
let attacker_name = players
.iter()
.find(|p| p.steam_id == attacker.to_string())
@@ -520,6 +526,9 @@ async fn perround(
common::demo_analysis::RoundEvent::Killed {
attacker: attacker_name,
died: died_name,
weapon,
headshot,
noscope,
}
}
})