Skip to content

Commit

Permalink
feat(match2): show mapRow for set players but missing winner/map on a…
Browse files Browse the repository at this point in the history
…oe (#5227)
  • Loading branch information
hjpalpha authored Dec 22, 2024
1 parent ae5b556 commit 41c3f0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/match2/commons/match_group_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ MatchGroupUtil.types.Walkover = TypeUtil.literalUnion('l', 'ff', 'dq')
---@field vod string?
---@field walkover WalkoverType?
---@field winner integer?
---@field status string?
---@field extradata table?
MatchGroupUtil.types.Game = TypeUtil.struct({
comment = 'string?',
Expand Down
6 changes: 4 additions & 2 deletions components/match2/wikis/ageofempires/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ local Array = require('Module:Array')
local DateExt = require('Module:Date/Ext')
local Faction = require('Module:Faction')
local Game = require('Module:Game')
local Logic = require('Module:Logic')
local Lua = require('Module:Lua')
local MapMode = require('Module:MapMode')
local Operator = require('Module:Operator')
local String = require('Module:StringUtils')
local Table = require('Module:Table')

local DisplayHelper = Lua.import('Module:MatchGroup/Display/Helper')
Expand Down Expand Up @@ -83,7 +83,9 @@ end
---@param props {game: string?, soloMode: boolean}
---@return Widget?
function CustomMatchSummary._createGame(game, props)
if not game.map and not game.winner and String.isEmpty(game.resultType) then return end
if (not game.map) and (not game.winner) and Logic.isEmpty(game.status) and Logic.isDeepEmpty(game.opponents) then
return
end

local normGame = Game.abbreviation{game = props.game}:lower()
game.mapDisplayName = game.mapDisplayName or game.map
Expand Down

0 comments on commit 41c3f0a

Please sign in to comment.