Skip to content

Commit

Permalink
LPA-6543: Customs that do resolve redirect on Player Pages must set u…
Browse files Browse the repository at this point in the history
…nderscore (#1823)

* Match2: Wiki customs that do resolve redirect on Player Pages must set underscore

* Fix attach
  • Loading branch information
Rathoz committed Oct 4, 2022
1 parent 922e295 commit 1d908a7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function matchFunctions.getPlayersOfTeam(match, oppIndex, teamName, playersData)
or Variables.varDefault(teamName .. '_p' .. playerIndex .. 'dn')

if String.isNotEmpty(player.name) then
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name)
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name):gsub(' ', '_')
end

if not Table.isEmpty(player) then
Expand Down Expand Up @@ -513,7 +513,7 @@ function mapFunctions.getParticipants(map, opponents)
end

function mapFunctions.attachToParticipant(player, opponentIndex, players, participants, champion, kda)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player):gsub(' ', '_')
for playerIndex, item in pairs(players or {}) do
if player == item.name then
participants[opponentIndex .. '_' .. playerIndex] = {
Expand Down
2 changes: 1 addition & 1 deletion components/match2/wikis/dota2/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ function matchFunctions.getPlayersOfTeam(match, oppIndex, teamName)
player.displayname = player.displayname or Variables.varDefault(teamName .. '_p' .. playerIndex .. 'dn')

if String.isNotEmpty(player.name) then
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name)
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name):gsub(' ', '_')
end

if not Table.isEmpty(player) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ function matchFunctions.getPlayersOfTeam(match, oppIndex, teamName)
player.displayname = player.displayname or Variables.varDefault(teamName .. '_p' .. playerIndex .. 'dn')

if String.isNotEmpty(player.name) then
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name)
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name):gsub(' ', '_')
end

if not Table.isEmpty(player) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function matchFunctions.getPlayersOfTeam(match, oppIndex, teamName, playersData)
or Variables.varDefault(teamName .. '_p' .. playerIndex .. 'dn')

if String.isNotEmpty(player.name) then
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name)
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name):gsub(' ', '_')
end

if not Table.isEmpty(player) then
Expand Down Expand Up @@ -513,7 +513,7 @@ function mapFunctions.getParticipants(map, opponents)
end

function mapFunctions.attachToParticipant(player, opponentIndex, players, participants, champion, kda)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player):gsub(' ', '_')
for playerIndex, item in pairs(players or {}) do
if player == item.name then
participants[opponentIndex .. '_' .. playerIndex] = {
Expand Down
4 changes: 2 additions & 2 deletions components/match2/wikis/pokemon/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function matchFunctions.getPlayersOfTeam(match, oppIndex, teamName, playersData)
or Variables.varDefault(teamName .. '_p' .. playerIndex .. 'dn')

if String.isNotEmpty(player.name) then
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name)
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name):gsub(' ', '_')
end

if not Table.isEmpty(player) then
Expand Down Expand Up @@ -513,7 +513,7 @@ function mapFunctions.getParticipants(map, opponents)
end

function mapFunctions.attachToParticipant(player, opponentIndex, players, participants, champion, kda)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player):gsub(' ', '_')
for playerIndex, item in pairs(players or {}) do
if player == item.name then
participants[opponentIndex .. '_' .. playerIndex] = {
Expand Down
4 changes: 2 additions & 2 deletions components/match2/wikis/wildrift/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ function matchFunctions.getPlayersOfTeam(match, oppIndex, teamName, playersData)
or Variables.varDefault(teamName .. '_p' .. playerIndex .. 'dn')

if String.isNotEmpty(player.name) then
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name)
player.name = mw.ext.TeamLiquidIntegration.resolve_redirect(player.name):gsub(' ', '_')
end

if not Table.isEmpty(player) then
Expand Down Expand Up @@ -513,7 +513,7 @@ function mapFunctions.getParticipants(map, opponents)
end

function mapFunctions.attachToParticipant(player, opponentIndex, players, participants, champion, kda)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player)
player = mw.ext.TeamLiquidIntegration.resolve_redirect(player):gsub(' ', '_')
for playerIndex, item in pairs(players or {}) do
if player == item.name then
participants[opponentIndex .. '_' .. playerIndex] = {
Expand Down

0 comments on commit 1d908a7

Please sign in to comment.