Skip to content

Commit

Permalink
feat(match2): add vodgameX support in sc(2) legacy wrappers (#5140)
Browse files Browse the repository at this point in the history
* sc2

* broodwar
  • Loading branch information
hjpalpha authored Dec 3, 2024
1 parent 7933169 commit 08fd0c1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function MatchGroupLegacyDefault:getMap()
map = 'map$1$',
winner = 'map$1$win',
race1 = 'map$1$p1race',
race2 = 'map$1$p2race'
race2 = 'map$1$p2race',
vod = 'vodgame$1$',
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ function MatchMapsLegacy._handleMaps(match)
winner = match['map' .. gameIndex .. 'win'],
race1 = match['map' .. gameIndex .. 'p1race'],
race2 = match['map' .. gameIndex .. 'p2race'],
vod = match['vodgame' .. gameIndex],
}

match['map' .. gameIndex .. 'win'] = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ function MatchGroupLegacyDefault:getMap()
map = 'map$1$',
winner = 'map$1$win',
race1 = 'map$1$p1race',
race2 = 'map$1$p2race'
race2 = 'map$1$p2race',
vod = 'vodgame$1$',
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function MatchMapsLegacy._handleMaps()
winner = mapWinner,
race1 = storageArgs['map' .. gameIndex .. 'p1race'],
race2 = storageArgs['map' .. gameIndex .. 'p2race'],
vod = storageArgs['vodgame' .. gameIndex],
}

storageArgs['map' .. gameIndex .. 'win'] = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function MatchMapsTeamLegacy._handleMaps()
local mapWinner = _match2Args[prefix .. 'win']

while map or mapWinner do
_match2Args['map' .. gameIndex] = MatchMapsTeamLegacy._processSingleMap(prefix, map, mapWinner)
_match2Args['map' .. gameIndex] = MatchMapsTeamLegacy._processSingleMap(prefix, map, mapWinner, gameIndex)

gameIndex = gameIndex + 1
prefix = 'm' .. gameIndex
Expand All @@ -68,12 +68,13 @@ function MatchMapsTeamLegacy._handleMaps()
end
end

function MatchMapsTeamLegacy._processSingleMap(prefix, map, mapWinner)
function MatchMapsTeamLegacy._processSingleMap(prefix, map, mapWinner, gameIndex)
local archon = Logic.readBool(_match2Args[prefix .. 'archon'])

local mapArgs = {
map = map or 'unknown',
winner = mapWinner,
vod = _match2Args['vodgame' .. gameIndex],
}
mapArgs = MatchMapsTeamLegacy._processMapOpponent(1, prefix, mapArgs, archon)
mapArgs = MatchMapsTeamLegacy._processMapOpponent(2, prefix, mapArgs, archon)
Expand Down

0 comments on commit 08fd0c1

Please sign in to comment.