Skip to content

Commit

Permalink
fix(match2): Handle default map win in legacy wrapper on AoE (#4919)
Browse files Browse the repository at this point in the history
* Handle default win

* use MatchGroupInputUtil constant
  • Loading branch information
LuckeLucky authored Oct 19, 2024
1 parent 4e2af6e commit 6ff9d6d
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
local Arguments = require('Module:Arguments')
local Array = require('Module:Array')
local Json = require('Module:Json')
local MatchGroupInputUtil = require('Module:MatchGroup/Input/Util')
local String = require('Module:StringUtils')
local Table = require('Module:Table')

local LegacyBracketMatchSummary = {}

local DEFAULT = 'default'

---@param args table
---@return table
function LegacyBracketMatchSummary._handleMaps(args)
Expand All @@ -36,9 +40,16 @@ function LegacyBracketMatchSummary._handleMaps(args)
vod = Table.extract(args, 'vodgame' .. mapIndex),
date = Table.extract(args, 'date' .. mapIndex) or Table.extract(matchTeam, 'date'),
}
if mapArgs.map then
local mapInfo = Array.parseCommaSeparatedString(mapArgs.map, '|')
mapArgs.map = mapInfo[1]

local map = mapArgs.map
if map then
local mapInfo = Array.parseCommaSeparatedString(map, '|')
map = mapInfo[1]
if String.startsWith(map:lower(), DEFAULT) then
map = nil
mapArgs.walkover = MatchGroupInputUtil.STATUS_INPUTS.DEFAULT_WIN
end
mapArgs.map = map
end

isValidMap = mapArgs.map ~= nil or mapArgs.winner
Expand Down

0 comments on commit 6ff9d6d

Please sign in to comment.