diff --git a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua index 14feb3c18bb..42672eba52f 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua @@ -80,11 +80,10 @@ function StarcraftMatchGroupInput.processMatch(match, options) match.finished = MatchGroupInputUtil.matchIsFinished(match, opponents) if match.finished then - match.resulttype = MatchGroupInputUtil.getResultType(winnerInput, finishedInput, opponents) - match.walkover = MatchGroupInputUtil.getWalkover(match.resulttype, opponents) - match.winner = MatchGroupInputUtil.getWinner(match.resulttype, winnerInput, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + match.winner = MatchGroupInputUtil.getWinner(match.status, winnerInput, opponents) Array.forEach(opponents, function(opponent, opponentIndex) - opponent.placement = MatchGroupInputUtil.placementFromWinner(match.resulttype, match.winner, opponentIndex) + opponent.placement = MatchGroupInputUtil.placementFromWinner(match.status, match.winner, opponentIndex) end) end diff --git a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua index 3e1526c7e06..0888c79c79f 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua @@ -55,7 +55,7 @@ function StarcraftFfaMatchGroupInput.processMatch(match, options) if MatchGroupInputUtil.isNotPlayed(match.winner, finishedInput) then match.finished = true - match.resulttype = MatchGroupInputUtil.RESULT_TYPE.NOT_PLAYED + match.status = MatchGroupInputUtil.MATCH_STATUS.NOT_PLAYED match.extradata = {ffa = 'true'} return match end @@ -79,10 +79,9 @@ function StarcraftFfaMatchGroupInput.processMatch(match, options) end) if match.finished then - match.resulttype = MatchGroupInputUtil.getResultType(match.winner, finishedInput, opponents) - match.walkover = MatchGroupInputUtil.getWalkover(match.resulttype, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(match.winner, finishedInput) StarcraftFfaMatchGroupInput._setPlacements(opponents) - match.winner = StarcraftFfaMatchGroupInput._getWinner(opponents, match.winner, match.resulttype) + match.winner = StarcraftFfaMatchGroupInput._getWinner(opponents, match.winner) end Array.forEach(opponents, function(opponent) @@ -229,7 +228,7 @@ function MapFunctions.readMap(mapInput, opponentCount, hasScores) map.resulttype = MatchGroupInputUtil.getResultType(mapInput.winner, mapInput.finished, opponentsInfo) map.walkover = MatchGroupInputUtil.getWalkover(map.resulttype, opponentsInfo) StarcraftFfaMatchGroupInput._setPlacements(opponentsInfo, not hasScores) - map.winner = StarcraftFfaMatchGroupInput._getWinner(opponentsInfo, mapInput.winner, map.resulttype) + map.winner = StarcraftFfaMatchGroupInput._getWinner(opponentsInfo, mapInput.winner) end Array.forEach(opponentsInfo, function(opponentInfo, opponentIndex) @@ -336,12 +335,11 @@ end ---@param opponents {placement: integer?, score: integer?, status: string} ---@param winnerInput integer|string|nil ----@param resultType string? ---@return integer? -function StarcraftFfaMatchGroupInput._getWinner(opponents, winnerInput, resultType) +function StarcraftFfaMatchGroupInput._getWinner(opponents, winnerInput) if Logic.isNumeric(winnerInput) then return tonumber(winnerInput) - elseif resultType == MatchGroupInputUtil.RESULT_TYPE.DRAW then + elseif MatchGroupInputUtil.isDraw(opponents, winnerInput) then return MatchGroupInputUtil.WINNER_DRAW end diff --git a/components/match2/wikis/ageofempires/match_group_input_custom.lua b/components/match2/wikis/ageofempires/match_group_input_custom.lua index aa28eb07e53..17b9d3fe974 100644 --- a/components/match2/wikis/ageofempires/match_group_input_custom.lua +++ b/components/match2/wikis/ageofempires/match_group_input_custom.lua @@ -66,11 +66,10 @@ function CustomMatchGroupInput.processMatch(match, options) match.finished = MatchGroupInputUtil.matchIsFinished(match, opponents) if match.finished then - match.resulttype = MatchGroupInputUtil.getResultType(winnerInput, finishedInput, opponents) - match.walkover = MatchGroupInputUtil.getWalkover(match.resulttype, opponents) - match.winner = MatchGroupInputUtil.getWinner(match.resulttype, winnerInput, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + match.winner = MatchGroupInputUtil.getWinner(match.status, winnerInput, opponents) Array.forEach(opponents, function(opponent, opponentIndex) - opponent.placement = MatchGroupInputUtil.placementFromWinner(match.resulttype, match.winner, opponentIndex) + opponent.placement = MatchGroupInputUtil.placementFromWinner(match.status, match.winner, opponentIndex) end) end diff --git a/components/match2/wikis/apexlegends/match_group_input_custom.lua b/components/match2/wikis/apexlegends/match_group_input_custom.lua index 6259a3302fb..ff6d2ac4e46 100644 --- a/components/match2/wikis/apexlegends/match_group_input_custom.lua +++ b/components/match2/wikis/apexlegends/match_group_input_custom.lua @@ -66,12 +66,8 @@ function CustomMatchGroupInput.processMatch(match, options) match.finished = MatchGroupInputUtil.matchIsFinished(match, opponents) if match.finished then - match.resulttype = - MatchGroupInputUtil.isNotPlayed(winnerInput, finishedInput) - and MatchGroupInputUtil.RESULT_TYPE.NOT_PLAYED - or nil - match.walkover = nil - match.winner = MatchGroupInputUtil.getWinner(match.resulttype, winnerInput, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + match.winner = MatchGroupInputUtil.getWinner(match.status, winnerInput, opponents) local placementOfTeams = CustomMatchGroupInput.calculatePlacementOfTeams(opponents) Array.forEach(opponents, function(opponent, opponentIndex) diff --git a/components/match2/wikis/counterstrike/match_group_input_custom.lua b/components/match2/wikis/counterstrike/match_group_input_custom.lua index 63c1a2bf9cf..04bf9da556a 100644 --- a/components/match2/wikis/counterstrike/match_group_input_custom.lua +++ b/components/match2/wikis/counterstrike/match_group_input_custom.lua @@ -67,11 +67,10 @@ function CustomMatchGroupInput.processMatch(match, options) match.finished = MatchGroupInputUtil.matchIsFinished(match, opponents) if match.finished then - match.resulttype = MatchGroupInputUtil.getResultType(winnerInput, finishedInput, opponents) - match.walkover = MatchGroupInputUtil.getWalkover(match.resulttype, opponents) - match.winner = MatchGroupInputUtil.getWinner(match.resulttype, winnerInput, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + match.winner = MatchGroupInputUtil.getWinner(match.status, winnerInput, opponents) Array.forEach(opponents, function(opponent, opponentIndex) - opponent.placement = MatchGroupInputUtil.placementFromWinner(match.resulttype, match.winner, opponentIndex) + opponent.placement = MatchGroupInputUtil.placementFromWinner(match.status, match.winner, opponentIndex) end) end @@ -245,7 +244,7 @@ end function MatchFunctions.getExtraData(match, opponents, finishedInput) return { mapveto = MatchGroupInputUtil.getMapVeto(match), - status = match.resulttype == MatchGroupInputUtil.RESULT_TYPE.NOT_PLAYED and finishedInput or nil, + 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')) diff --git a/components/match2/wikis/stormgate/match_group_input_custom.lua b/components/match2/wikis/stormgate/match_group_input_custom.lua index 12765be66b9..b8e078c21bf 100644 --- a/components/match2/wikis/stormgate/match_group_input_custom.lua +++ b/components/match2/wikis/stormgate/match_group_input_custom.lua @@ -93,11 +93,10 @@ function CustomMatchGroupInput.processMatch(match, options) match.finished = MatchGroupInputUtil.matchIsFinished(match, opponents) if match.finished then - match.resulttype = MatchGroupInputUtil.getResultType(winnerInput, finishedInput, opponents) - match.walkover = MatchGroupInputUtil.getWalkover(match.resulttype, opponents) - match.winner = MatchGroupInputUtil.getWinner(match.resulttype, winnerInput, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + match.winner = MatchGroupInputUtil.getWinner(match.status, winnerInput, opponents) Array.forEach(opponents, function(opponent, opponentIndex) - opponent.placement = MatchGroupInputUtil.placementFromWinner(match.resulttype, match.winner, opponentIndex) + opponent.placement = MatchGroupInputUtil.placementFromWinner(match.status, match.winner, opponentIndex) end) end diff --git a/components/match2/wikis/warcraft/match_group_input_custom.lua b/components/match2/wikis/warcraft/match_group_input_custom.lua index 9badfa5fb11..e5a254fa8de 100644 --- a/components/match2/wikis/warcraft/match_group_input_custom.lua +++ b/components/match2/wikis/warcraft/match_group_input_custom.lua @@ -99,11 +99,10 @@ function CustomMatchGroupInput.processMatch(match, options) match.finished = MatchGroupInputUtil.matchIsFinished(match, opponents) if match.finished then - match.resulttype = MatchGroupInputUtil.getResultType(winnerInput, finishedInput, opponents) - match.walkover = MatchGroupInputUtil.getWalkover(match.resulttype, opponents) - match.winner = MatchGroupInputUtil.getWinner(match.resulttype, winnerInput, opponents) + match.status = MatchGroupInputUtil.getMatchStatus(winnerInput, finishedInput) + match.winner = MatchGroupInputUtil.getWinner(match.status, winnerInput, opponents) Array.forEach(opponents, function(opponent, opponentIndex) - opponent.placement = MatchGroupInputUtil.placementFromWinner(match.resulttype, match.winner, opponentIndex) + opponent.placement = MatchGroupInputUtil.placementFromWinner(match.status, match.winner, opponentIndex) end) end