From 98f327466da367efa69ffb1eec89a2e6ff76e494 Mon Sep 17 00:00:00 2001 From: Lanta Date: Wed, 17 Jul 2024 16:22:53 +0200 Subject: [PATCH] kd calculated per match --- update/matchparser.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index 798d18e..34e4520 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -181,8 +181,8 @@ function Get-MatchStatsPlayer { if ($MatchType) { $filterProperty = 'matchType' } - #$alives = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deathType | Measure-Object -sum).sum - $deaths = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).deaths | Measure-Object -sum).sum + $alives = (($killstats | where-object { $_.stats.playername -eq $player -and $_.stats.$filterProperty -like $typemodevalue }).deathType | where-object {$_ -eq 'alive'}).count + $deaths = (($killstats | where-object { $_.stats.playername -eq $player -and $_.stats.$filterProperty -like $typemodevalue }).deathType | where-object {$_ -ne 'alive'}).count $kills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).kills | Measure-Object -sum).sum $dbno = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).dbno | Measure-Object -sum).sum $humankills = (($killstats.stats | where-object { $_.playername -eq $player -and $_.$filterProperty -like $typemodevalue }).humankills | Measure-Object -sum).sum @@ -206,8 +206,8 @@ function Get-MatchStatsPlayer { kills = $kills humankills = $humankills matches = $player_matches - KD_H = $humankills / $deaths - KD_ALL = $kills / $deaths + KD_H = $humankills / ($deaths + $alives) # KD_Human calculated per match (kills / (deaths + alives)) + KD_ALL = $kills / ($deaths + $alives) # KD_ALL calculated per match (kills / (deaths + alives)) winratio = $winratio wins = $player_wins dbno = $dbno