From d5988ea0203c86f2b04fe185bfb1c776ff14d823 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:48:11 +0100 Subject: [PATCH] chore(match2): remove temp workaround on sc(2) after cleanup (#5201) * chore(match2): remove temp workaround after cleanup * as per review --- .../match_group_input_starcraft_ffa.lua | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) 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 71f82285d9..64809a5095 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 @@ -202,7 +202,7 @@ function MapFunctions.readMap(mapInput, opponentCount, hasScores) end map.opponents = Array.map(Array.range(1, opponentCount), function(opponentIndex) - return MapFunctions.getOpponentInfo(mapInput, opponentIndex, hasScores) + return MapFunctions.getOpponentInfo(mapInput, opponentIndex) end) map.scores = Array.map(map.opponents, Operator.property('score')) @@ -236,16 +236,10 @@ function MapFunctions.isFinished(mapInput, opponentCount, hasScores) end) end ----@param mapInput any ----@param opponentIndex any ----@param hasScores any +---@param mapInput table +---@param opponentIndex integer ---@return {placement: integer?, score: integer?, status: string} -function MapFunctions.getOpponentInfo(mapInput, opponentIndex, hasScores) - -- next 3 lines are temp workaround to adjust usage on the wiki after merge - if not hasScores and Logic.isEmpty(mapInput['placement' .. opponentIndex]) then - mapInput['score' .. opponentIndex] = 'L' - end - +function MapFunctions.getOpponentInfo(mapInput, opponentIndex) local score, status = MatchGroupInputUtil.computeOpponentScore{ walkover = mapInput.walkover, winner = mapInput.winner, @@ -255,7 +249,7 @@ function MapFunctions.getOpponentInfo(mapInput, opponentIndex, hasScores) return { placement = tonumber(mapInput['placement' .. opponentIndex]), - score = hasScores and score or nil, + score = score, status = status, } end