From 80c6555d5e77e62bb45ed845464b3a71632d72a9 Mon Sep 17 00:00:00 2001 From: Rikard Blixt Date: Sat, 19 Oct 2024 10:40:08 +0200 Subject: [PATCH] add comment about orig matchid --- components/match2/wikis/dota2/match_summary.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/match2/wikis/dota2/match_summary.lua b/components/match2/wikis/dota2/match_summary.lua index bb224b3d339..17237cd60eb 100644 --- a/components/match2/wikis/dota2/match_summary.lua +++ b/components/match2/wikis/dota2/match_summary.lua @@ -58,13 +58,17 @@ end ---@param match MatchGroupUtilMatch ---@return MatchSummaryBody function CustomMatchSummary.createBody(match) + -- Original Match Id must be used to match page links if it exists. + -- It can be different from the matchId when shortened brackets are used. + local matchId = match.extradata.originalmatchid or match.matchId + local showCountdown = match.timestamp ~= DateExt.defaultTimestamp local showMatchPage = MatchPage.isEnabledFor(match) local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS) return MatchSummaryWidgets.Body{children = WidgetUtil.collect( showCountdown and MatchSummaryWidgets.Row{children = DisplayHelper.MatchCountdownBlock(match)} or nil, - showMatchPage and MatchSummaryWidgets.MatchPageLink{matchId = match.extradata.originalmatchid or match.matchId} or nil, + showMatchPage and MatchSummaryWidgets.MatchPageLink{matchId = matchId} or nil, unpack(Array.map(match.games, CustomMatchSummary._createGame)), MatchSummaryWidgets.Mvp(match.extradata.mvp), MatchSummaryWidgets.CharacterBanTable{bans = characterBansData, date = match.date},