diff --git a/components/match2/commons/match_group_input_util.lua b/components/match2/commons/match_group_input_util.lua index 33d4e91c643..b6b1d36790f 100644 --- a/components/match2/commons/match_group_input_util.lua +++ b/components/match2/commons/match_group_input_util.lua @@ -1080,7 +1080,7 @@ end ---@class MatchParserInterface ---@field extractMaps fun(match: table, opponents: table[], mapProps: any?): table[] ---@field getBestOf fun(bestOfInput: string|integer, maps: table[]): integer ----@field calculateMatchScore fun(maps: table[]): fun(opponentIndex: integer): integer +---@field calculateMatchScore? fun(maps: table[]): fun(opponentIndex: integer): integer ---@field removeUnsetMaps? fun(maps: table[]): table[] ---@field getExtraData? fun(match: table, games: table[], opponents: table[]): table ---@field getLinks? fun(match: table, games: table[]): table @@ -1093,9 +1093,9 @@ end --- The Parser injection must have the following functions: --- - extractMaps(match, opponents, mapProps): table[] --- - getBestOf(bestOfInput, maps): integer ---- - calculateMatchScore(maps): fun(opponentIndex): integer --- --- It may optionally have the following functions: +--- - calculateMatchScore(maps): fun(opponentIndex): integer --- - removeUnsetMaps(maps): table[] --- - getExtraData(match, games, opponents): table --- - getLinks @@ -1124,7 +1124,7 @@ function MatchGroupInputUtil.standardProcessMatch(match, Parser, mapProps) match.links = Parser.getLinks and Parser.getLinks(match, games) or MatchGroupInputUtil.getLinks(match) - local autoScoreFunction = MatchGroupInputUtil.canUseAutoScore(match, games) + local autoScoreFunction = (Parser.calculateMatchScore and MatchGroupInputUtil.canUseAutoScore(match, games)) and Parser.calculateMatchScore(games) or nil Array.forEach(opponents, function(opponent, opponentIndex)