Skip to content

fix(match2): broken links in valorant map veto display#7596

Open
ElectricalBoy wants to merge 2 commits into
mainfrom
val-mapveto-red-links
Open

fix(match2): broken links in valorant map veto display#7596
ElectricalBoy wants to merge 2 commits into
mainfrom
val-mapveto-red-links

Conversation

@ElectricalBoy
Copy link
Copy Markdown
Collaborator

@ElectricalBoy ElectricalBoy commented Jun 2, 2026

Summary

if options.game then
return {name = map, link = map .. '/' .. options.game}
end

MatchSummaryWidgets.MapVeto(MatchSummary.preProcessMapVeto(match.extradata.mapveto, {game = match.game}))

The game = match.game option passed into MatchSummary.preProcessMapVeto caused the returned links to have /val appended to the returned link. This wasn't a problem until #7586 as the link was never used for display due to key inconsistency (see #7586 (comment)).

This PR fixes the above issue by adding a LPDB map check, similar to how match pages handle map veto.

How did you test this change?

dev

@ElectricalBoy ElectricalBoy requested review from a team June 2, 2026 01:59
Copy link
Copy Markdown
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could potentially throw if a "game" is used that is not set in module imfo
can test later this week (only on mobile today)

@ElectricalBoy
Copy link
Copy Markdown
Collaborator Author

could potentially throw if a "game" is used that is not set in module imfo

map infobox already includes game input check as shown below, so it is safe enough to assume that it never throws

---Returns the respective game for this map
---@param args table
---@return string?
function Map:getGame(args)
local game = Game.name{
game = args.game,
useDefault = args.useDefaultGame
}
assert(game, 'Missing or invalid game specified')
---@cast game -nil
return game
end

extradata = Table.merge(
creatorsToLpdbData(),
{
game = self:getGame(args),
modes = self:getGameModes(args),
}
)

@hjpalpha
Copy link
Copy Markdown
Collaborator

hjpalpha commented Jun 2, 2026

could potentially throw if a "game" is used that is not set in module imfo

map infobox already includes game input check as shown below, so it is safe enough to assume that it never throws

---Returns the respective game for this map
---@param args table
---@return string?
function Map:getGame(args)
local game = Game.name{
game = args.game,
useDefault = args.useDefaultGame
}
assert(game, 'Missing or invalid game specified')
---@cast game -nil
return game
end

extradata = Table.merge(
creatorsToLpdbData(),
{
game = self:getGame(args),
modes = self:getGameModes(args),
}
)

there are exceptions
you could test on https://liquipedia.net/starcraft2/Sunrise_Cup/2021_National_Day

@ElectricalBoy
Copy link
Copy Markdown
Collaborator Author

there are exceptions
you could test on https://liquipedia.net/starcraft2/Sunrise_Cup/2021_National_Day

I don't see how the linked page is relevant to this PR?
sc2 doesn't call MatchSummaryBase.preProcessMapVeto in the first place, not to mention that it stores nothing to the match2 table

@hjpalpha
Copy link
Copy Markdown
Collaborator

hjpalpha commented Jun 2, 2026

there are exceptions
you could test on https://liquipedia.net/starcraft2/Sunrise_Cup/2021_National_Day

I don't see how the linked page is relevant to this PR? sc2 doesn't call MatchSummaryBase.preProcessMapVeto in the first place, not to mention that it stores nothing to the match2 table

ah right we don't use this

Copy link
Copy Markdown
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/shrug

@mbergen
Copy link
Copy Markdown
Collaborator

mbergen commented Jun 3, 2026

Seems like worldoftanks would like the same treatment: https://discord.com/channels/93055209017729024/372075546231832576/1511717722977734766

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants