diff --git a/components/match2/commons/match_group_input_util.lua b/components/match2/commons/match_group_input_util.lua index dab3998b786..fda06f5c543 100644 --- a/components/match2/commons/match_group_input_util.lua +++ b/components/match2/commons/match_group_input_util.lua @@ -838,7 +838,7 @@ function MatchGroupInputUtil.matchIsFinished(match, opponents) end local playall = tonumber(match.playall) or 0 - if playall then + if playall > 0 then return MatchGroupInputUtil.allHasBeenPlayed(playall, opponents) end @@ -902,10 +902,7 @@ end ---@return boolean function MatchGroupInputUtil.allHasBeenPlayed(playall, opponents) local scoreSum = Array.reduce(opponents, function(sum, opponent) return sum + (opponent.score or 0) end, 0) - if scoreSum >= playall then - return true - end - return false + return scoreSum >= playall end ---@param bestOfInput string|integer? @@ -915,12 +912,6 @@ function MatchGroupInputUtil.getBestOf(bestOfInput, maps) return tonumber(bestOfInput) or #maps end ----@param playAllInput string|integer? ----@return integer? -function MatchGroupInputUtil.getPlayAll(playAllInput) - return tonumber(playAllInput) or 0 -end - ---@param alias table ---@param character string? ---@return string? @@ -1069,7 +1060,6 @@ end ---@class MatchParserInterface ---@field extractMaps fun(match: table, opponents: table[], mapProps: any?): table[] ---@field getBestOf fun(bestOfInput: string|integer|nil, maps: table[]): integer? ----@field getPlayAll fun(playAllInput: string|integer|nil): integer? ---@field calculateMatchScore? fun(maps: table[], opponents: table[]): fun(opponentIndex: integer): integer? ---@field removeUnsetMaps? fun(maps: table[]): table[] ---@field getExtraData? fun(match: table, games: table[], opponents: table[]): table? @@ -1103,7 +1093,6 @@ end --- - getHeadToHeadLink(match, opponents): string? --- - readDate(match): table --- - getMode(opponents): string? ---- - getPlayAll(playAllinput): integer? --- --- Additionally, the Parser may have the following properties: --- - DEFAULT_MODE: string @@ -1166,10 +1155,8 @@ function MatchGroupInputUtil.standardProcessMatch(match, Parser, mapProps) match.stream = Streams.processStreams(match) match.extradata = Parser.getExtraData and Parser.getExtraData(match, games, opponents) or {} - local playallData = { - playall = Parser.getPlayAll and Parser.getPlayAll(match.playall) or MatchGroupInputUtil.getPlayAll(match.playall) - } - match.extradata = Table.merge(playallData, match.extradata) + match.extradata = Table.merge({playall = tonumber(match.playall)}, match.extradata) + match.bestof = tonumber(match.playall) --For display in existing Bestof? match.games = games match.opponents = opponents diff --git a/components/match2/wikis/ageofempires/match_group_input_custom.lua b/components/match2/wikis/ageofempires/match_group_input_custom.lua index f7cc9d5d053..a66ba7ccf83 100644 --- a/components/match2/wikis/ageofempires/match_group_input_custom.lua +++ b/components/match2/wikis/ageofempires/match_group_input_custom.lua @@ -241,7 +241,6 @@ end function CustomMatchGroupInput._getExtraData(match) return { casters = MatchGroupInputUtil.readCasters(match, {noSort = true}), - playall = MatchGroupInputUtil.getPlayAll(match.playall) } end diff --git a/components/match2/wikis/counterstrike/match_group_input_custom.lua b/components/match2/wikis/counterstrike/match_group_input_custom.lua index ff26d1c104d..582fa441ceb 100644 --- a/components/match2/wikis/counterstrike/match_group_input_custom.lua +++ b/components/match2/wikis/counterstrike/match_group_input_custom.lua @@ -213,8 +213,7 @@ function MatchFunctions.getExtraData(match, opponents, finishedInput) status = match.status == MatchGroupInputUtil.MATCH_STATUS.NOT_PLAYED and finishedInput or nil, overturned = Logic.isNotEmpty(match.overturned), featured = MatchFunctions.isFeatured(match, opponents), - hidden = Logic.readBool(Variables.varDefault('match_hidden')), - playall = match.playall + hidden = Logic.readBool(Variables.varDefault('match_hidden')) } end diff --git a/components/transfer/commons/transfer_references.lua b/components/transfer/commons/transfer_references.lua index f774c2e811f..26bf2812302 100644 --- a/components/transfer/commons/transfer_references.lua +++ b/components/transfer/commons/transfer_references.lua @@ -311,4 +311,4 @@ function TransferRef._getTextAndLink(reference, options) end end -return TransferRef \ No newline at end of file +return TransferRef