more kill info

This commit is contained in:
Robin Appelman 2026-11-12 19:38:41 +01:00
commit 5d1729110b
Signed by: robin
SSH key fingerprint: SHA256:kifqgrqnut7q1YUIrI0AdMNC23qiKAS/T9uGFmIYvbE
7 changed files with 196 additions and 99 deletions

View file

@ -2,7 +2,7 @@ use main_error::MainError;
use std::env::args;
use std::fs;
use tf_log_parser::module::Kills;
use tf_log_parser::parse_with_handler;
use tf_log_parser::{parse_with_handler, Class};
fn main() -> Result<(), MainError> {
let path = args().nth(1).expect("No path provided");
@ -11,6 +11,9 @@ fn main() -> Result<(), MainError> {
let kills = parse_with_handler::<Kills>(&content)?.0;
for kill in kills {
if kill.victim.class == Class::Medic && kill.charge.is_none() {
panic!("medic death without charge");
}
println!("{}", serde_json::to_string(&kill)?);
}
Ok(())