mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-03 10:14:10 +02:00
optimize kill registering
This commit is contained in:
parent
9d1fbf1320
commit
9bd6d16043
1 changed files with 5 additions and 5 deletions
|
|
@ -77,13 +77,13 @@ impl EventHandler for ClassStatsHandler {
|
||||||
self.active = false;
|
self.active = false;
|
||||||
}
|
}
|
||||||
GameEvent::Kill(kill) if self.active => {
|
GameEvent::Kill(kill) if self.active => {
|
||||||
if let Some(target_class) = self.get_class(&kill.target) {
|
|
||||||
subject_data.kills[target_class] += 1;
|
|
||||||
}
|
|
||||||
if let Ok(target) = kill.target.id() {
|
if let Ok(target) = kill.target.id() {
|
||||||
if let Some(subject_class) = self.data.get(&subject).map(|data| data.class) {
|
let subject_class = self.data.get(&subject).map(|data| data.class);
|
||||||
self.data_mut(target).deaths[subject_class] += 1;
|
let target_data = self.data_mut(target);
|
||||||
|
if let Some(subject_class) = subject_class {
|
||||||
|
target_data.deaths[subject_class] += 1;
|
||||||
}
|
}
|
||||||
|
subject_data.kills[target_data.class] += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GameEvent::KillAssist(assist) if self.active => {
|
GameEvent::KillAssist(assist) if self.active => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue