Skip to content

Commit

Permalink
feat(match2): handle AoE split teams (#4263)
Browse files Browse the repository at this point in the history
* fix(opponent) Add custom opponent with special name resolving

* Apply suggestions from review

* Mitigate issue in MatchLegacy and MatchGroupInputCustom instead of Opponent
  • Loading branch information
mbergen authored Aug 18, 2024
1 parent 1e8e594 commit 20f05e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ function CustomMatchGroupInput._getOpponents(match)
end
match['opponent' .. opponentIndex] = opponent

if opponent.type == Opponent.team and Logic.isNotEmpty(opponent.name) then
MatchGroupInput.readPlayersOfTeam(match, opponentIndex, opponent.name, {
if opponent.type == Opponent.team and Logic.isNotEmpty(opponent.template) then
MatchGroupInput.readPlayersOfTeam(match, opponentIndex, mw.ext.TeamTemplate.raw(opponent.template).page, {
resolveRedirect = true,
applyUnderScores = true,
maxNumPlayers = MAX_NUM_PLAYERS,
Expand Down
2 changes: 1 addition & 1 deletion components/match2/wikis/ageofempires/match_legacy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function MatchLegacy._convertParameters(match2)
match[prefix .. 'flag'] = player.flag
match.extradata[prefix .. 'name'] = player.displayname
elseif opponent.type == Opponent.team then
match[prefix] = opponent.name
match[prefix] = mw.ext.TeamTemplate.raw(opponent.template).page
match[prefix..'score'] = (tonumber(opponent.score) or 0) > 0 and opponent.score or 0
local opponentplayers = {}
for i, player in pairs(opponentmatch2players) do
Expand Down

0 comments on commit 20f05e7

Please sign in to comment.