From 4010e69cde6f56d9f89ebc52ff069b9eea65b5c2 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Wed, 12 Aug 2026 19:47:53 +0200 Subject: [PATCH] fix(match2): bo1 reset match display --- lua/wikis/commons/MatchGroup/Util.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/MatchGroup/Util.lua b/lua/wikis/commons/MatchGroup/Util.lua index 5ed56d1294e..2d0c9a4e1be 100644 --- a/lua/wikis/commons/MatchGroup/Util.lua +++ b/lua/wikis/commons/MatchGroup/Util.lua @@ -175,6 +175,7 @@ MatchGroupUtil.types.Player = TypeUtil.struct({ ---@field players standardPlayer[]? ---@field score number? ---@field scoreDisplay number? +---@field scoreDisplay2 number? ---@field score2 number? ---@field status string? ---@field status2 string? @@ -920,12 +921,28 @@ function MatchGroupUtil.mergeBracketResetMatch(match, bracketResetMatch) games = Table.copy(match.games), }) + local bestof = tonumber(bracketResetMatch.bestof) + local game1 = (bracketResetMatch.games or {})[1] + local hasOnlyScores = Array.all(bracketResetMatch.opponents, function(opponent) + return opponent.status == 'S' + end) + for ix, opponent in ipairs(match.opponents) do local resetOpponent = bracketResetMatch.opponents[ix] + + local status = resetOpponent.status + local scoreDisplay + if bestof == 1 and Info.config.match2.gameScoresIfBo1 and game1 and hasOnlyScores then + local mapOpponent = (game1.opponents or {})[ix] or {} + scoreDisplay = tonumber(mapOpponent.score) + status = mapOpponent.status + end + mergedMatch.opponents[ix] = Table.merge(opponent, { score2 = resetOpponent.score, - status2 = resetOpponent.status, + status2 = status, placement2 = resetOpponent.placement, + scoreDisplay2 = scoreDisplay, }) end