Skip to content

Commit

Permalink
fix(match2): typo in record parsing (#5271)
Browse files Browse the repository at this point in the history
fix(match2): typo
  • Loading branch information
Rathoz authored Jan 3, 2025
1 parent 62b0d91 commit c0a523f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/match2/commons/match_group_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -604,19 +604,19 @@ function MatchGroupUtil.bracketDataToRecord(bracketData)
}
end

---@param matchRecord table
---@param record table
---@param matchRecord match2
---@param record match2opponent
---@param opponentIndex integer
---@return standardOpponent
function MatchGroupUtil.opponentFromRecord(matchRecord, record, opponentIndex)
local extradata = MatchGroupUtil.parseOrCopyExtradata(record.extradata)

local score = tonumber(record.score)
local score = record.score
local status = record.status
local bestof = tonumber(matchRecord.bestof)
local game1 = (matchRecord.match2games or {})[1]
if bestof == 1 and Info.config.match2.gameScoresIfBo1 and game1 then
local mapOpponent = (game1.opponnets or {})[opponentIndex] or {}
local mapOpponent = (game1.opponents or {})[opponentIndex] or {}
score = mapOpponent.score
status = mapOpponent.status
end
Expand All @@ -629,7 +629,7 @@ function MatchGroupUtil.opponentFromRecord(matchRecord, record, opponentIndex)
name = nilIfEmpty(record.name),
placement = tonumber(record.placement),
players = Array.map(record.match2players, MatchGroupUtil.playerFromRecord),
score = score,
score = tonumber(score),
status = status,
template = nilIfEmpty(record.template),
type = nilIfEmpty(record.type) or 'literal',
Expand Down
2 changes: 2 additions & 0 deletions definitions/liquipedia_db.lua
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ local lpdb = {}
---@field match2gameid integer
---@field subgroup integer
---@field winner integer
---@field opponents table[]
---@field status string
---@field mode string
---@field type string
---@field game string
Expand Down

0 comments on commit c0a523f

Please sign in to comment.