1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fix issues with last release

This commit is contained in:
RaidMax
2021-07-12 14:57:44 -05:00
parent 19b5c456a5
commit 14d5c15fce
4 changed files with 22 additions and 7 deletions

View File

@ -47,15 +47,25 @@ namespace Stats.Client
hitType = eventType == 'D' ? HitType.Damage : HitType.Kill;
}
var damage = 0;
try
{
damage = Math.Min(MaximumDamage,
log.Length > parserRegex.GroupMapping[ParserRegex.GroupType.Damage]
? int.Parse(log[parserRegex.GroupMapping[ParserRegex.GroupType.Damage]])
: 0);
}
catch
{
// ignored
}
var hitInfo = new HitInfo()
{
EntityId = entityId,
IsVictim = isVictim,
HitType = hitType,
Damage = Math.Min(MaximumDamage,
log.Length > parserRegex.GroupMapping[ParserRegex.GroupType.Damage]
? int.Parse(log[parserRegex.GroupMapping[ParserRegex.GroupType.Damage]])
: 0),
Damage = damage,
Location = log.Length > parserRegex.GroupMapping[ParserRegex.GroupType.HitLocation]
? log[parserRegex.GroupMapping[ParserRegex.GroupType.HitLocation]]
: "Unknown",