From a8b429d506315338d5deb6babf9e0451bc59bdc4 Mon Sep 17 00:00:00 2001 From: stobbelaart Date: Sun, 26 Nov 2023 10:32:47 +0100 Subject: [PATCH] fix --- update/matchparser.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 358a58f..1a152e3 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -45,14 +45,15 @@ function get-killstats { $matchType, $gameMode ) - - $kills = $telemetry | where-object { $_.killer.name -eq $player_name -and $_._T -eq 'LOGPLAYERKILLV2' } + $LOGPLAYERKILLV2 = $telemetry | where-object { $_._T -eq 'LOGPLAYERKILLV2' } + $kills = $LOGPLAYERKILLV2 | where-object { $_.killer.name -eq $player_name} + $deaths = $LOGPLAYERKILLV2 | where-object { $_.victim.name -eq $player_name -and $_.finisher.name.count -ge 1 } $HumanDmg = $([math]::Round(($telemetry | Where-Object { $_._T -eq 'LOGPLAYERTAKEDAMAGE' -and $_.attacker.name -eq $player_name -and $_.victim.accountId -notlike "ai.*" -and $_.victim.teamId -ne $_.attacker.teamId } | Measure-Object -Property damage -Sum).Sum)) return @{ playername = $player_name humankills = ($kills | where-object { $_.victim.accountId -notlike 'ai.*' }).count kills = $kills.count - deaths = ($kills | where-object { $_.victim.name -eq $player_name }).count + deaths = ($deaths).count gameMode = $gameMode matchType = $matchType dbno = ($kills | where-object { $_.dBNOMaker.name -eq $player_name }).count