From 34c25b3358c39f43b4adaa61e613309f9614ba7a Mon Sep 17 00:00:00 2001 From: Rikard Blixt Date: Tue, 10 Dec 2024 15:45:23 +0100 Subject: [PATCH] fix placement merge in pdt --- components/match2/commons/match_summary_ffa.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/match2/commons/match_summary_ffa.lua b/components/match2/commons/match_summary_ffa.lua index baf41b75cc..6693a76432 100644 --- a/components/match2/commons/match_summary_ffa.lua +++ b/components/match2/commons/match_summary_ffa.lua @@ -365,17 +365,21 @@ function MatchSummaryFfa.createScoringData(match) local newScores = {} local lastData = {} for placement, placementData in ipairs(scoreSettings or {}) do - if Table.deepEquals(lastData, placementData) then + local currentData = { + killPoints = placementData.killPoints, + placementPoints = placementData.placementPoints, + } + if Table.deepEquals(lastData, currentData) then newScores[#newScores].rangeEnd = newScores[#newScores].rangeEnd + 1 else table.insert(newScores, { rangeStart = placement, rangeEnd = placement, - killScore = placementData.killPoints, - placementScore = placementData.placementPoints, + killScore = currentData.killPoints, + placementScore = currentData.placementPoints, }) end - lastData = placementData + lastData = currentData end return newScores end