From 4b6fc44f9aefe74f1e6c3730945a02d8a2b7dd21 Mon Sep 17 00:00:00 2001 From: hjpalpha Date: Thu, 12 Dec 2024 17:37:50 +0100 Subject: [PATCH] as per review --- .../match_group_input_starcraft_ffa.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 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 3287338a09..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,11 +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) +function MapFunctions.getOpponentInfo(mapInput, opponentIndex) local score, status = MatchGroupInputUtil.computeOpponentScore{ walkover = mapInput.walkover, winner = mapInput.winner, @@ -250,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