mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-03 10:14:10 +02:00
handle damage overflow
This commit is contained in:
parent
be0e0670e9
commit
f34e6ef094
1 changed files with 3 additions and 2 deletions
|
|
@ -95,9 +95,10 @@ impl EventHandler for ClassStatsHandler {
|
||||||
damage: Some(damage),
|
damage: Some(damage),
|
||||||
target,
|
target,
|
||||||
..
|
..
|
||||||
}) if self.active && damage > &0 && damage < &99999 => {
|
}) if self.active && damage > &0 && damage < &1500 => {
|
||||||
if let Some(target_class) = self.get_class(target) {
|
if let Some(target_class) = self.get_class(target) {
|
||||||
subject_data.damage[target_class] += *damage as u16;
|
subject_data.damage[target_class] =
|
||||||
|
subject_data.damage[target_class].saturating_add(*damage as u16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue