Skip to content

Commit

Permalink
fix(match2): new valorant game opponent handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Sep 17, 2024
1 parent 6e44cab commit 0076f49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/match2/commons/match.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ function Match._prepareGameRecordForStore(matchRecord, gameRecord)
gameRecord.participants = {}
for opponentId, opponent in ipairs(gameRecord.opponents) do
for playerId, player in pairs(opponent.players) do
gameRecord.participants[opponentId .. '_' .. playerId] = player
-- Deep copy have to be used here, otherwise a json.stringify complains about circular references
-- between participants and opponents
gameRecord.participants[opponentId .. '_' .. playerId] = Table.deepCopy(player)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function CustomMatchGroupInput.extractMaps(match, opponents)
local winnerInput = map.winner --[[@as string?]]

map.opponents = MapFunctions.getParticipants(map, opponents)
map.participants = nil
map.extradata = MapFunctions.getExtraData(map, map.opponents)
map.finished = MatchGroupInputUtil.mapIsFinished(map)

Expand Down

0 comments on commit 0076f49

Please sign in to comment.