From 238d63a431410b84f5be58296e23e4b4cbf8ee1e Mon Sep 17 00:00:00 2001 From: Corsaka Date: Mon, 31 Aug 2026 10:10:16 +0100 Subject: [PATCH 1/3] Reduce ban size to 2 By default, deadlock drafting only has 2 bans (and rarely, 3). 6 is excessive by default. --- lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua b/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua index fe04e833e7b..da5c887e79e 100644 --- a/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua +++ b/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua @@ -47,10 +47,10 @@ function WikiCopyPaste._getMapCode(mapIndex, bans) INDENT .. '|map' .. mapIndex .. '={{Map', INDENT .. INDENT .. '|team1side=', INDENT .. INDENT .. '|t1h1=|t1h2=|t1h3=|t1h4=|t1h5=|t1h6=', - bans and (INDENT .. INDENT .. '|t1b1=|t1b2=|t1b3=|t1b4=|t1b5=|t1b6=') or nil, + bans and (INDENT .. INDENT .. '|t1b1=|t1b2=') or nil, INDENT .. INDENT .. '|team2side=', INDENT .. INDENT .. '|t2h1=|t2h2=|t2h3=|t2h4=|t2h5=|t2h6=', - bans and (INDENT .. INDENT .. '|t2b1=|t2b2=|t2b3=|t2b4=|t2b5=|t2b6=') or nil, + bans and (INDENT .. INDENT .. '|t2b1=|t2b2=') or nil, INDENT .. INDENT .. '|length=|winner=|matchid=|vod=', INDENT .. '}}' ), '\n') From 0b4793f95f4d8bbff883e69b4accd447bf386559 Mon Sep 17 00:00:00 2001 From: Corsaka Date: Tue, 1 Sep 2026 18:38:23 +0100 Subject: [PATCH 2/3] feat(match2): customizable ban number in deadlock copypaste --- .../deadlock/GetMatchGroupCopyPaste/wiki.lua | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua b/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua index da5c887e79e..1d62b41bb1c 100644 --- a/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua +++ b/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua @@ -20,7 +20,7 @@ local INDENT = WikiCopyPaste.Indent function WikiCopyPaste.getMatchCode(bestof, mode, index, opponents, args) local showScore = Logic.nilOr(Logic.readBoolOrNil, bestof == 0) - local bans = Logic.readBool(args.bans) + local bans = args.bans local lines = Array.extend( '{{Match|bestof=' .. (bestof ~= 0 and bestof or ''), @@ -40,20 +40,32 @@ function WikiCopyPaste.getMatchCode(bestof, mode, index, opponents, args) end ---@param mapIndex integer ----@param bans boolean +---@param bans integer ---@return string function WikiCopyPaste._getMapCode(mapIndex, bans) + banBool = true + ban1Text = "" + ban2Text = "" + if bans == 0 then + banBool = false + else + for ban = 1, bans do + ban1Text = ban1Text .. "|t1b" .. ban .. "=" + ban2Text = ban2Text .. "|t2b" .. ban .. "=" + end + end return table.concat(Array.extend( INDENT .. '|map' .. mapIndex .. '={{Map', INDENT .. INDENT .. '|team1side=', INDENT .. INDENT .. '|t1h1=|t1h2=|t1h3=|t1h4=|t1h5=|t1h6=', - bans and (INDENT .. INDENT .. '|t1b1=|t1b2=') or nil, + banBool and (INDENT .. INDENT .. ban1Text) or nil, INDENT .. INDENT .. '|team2side=', INDENT .. INDENT .. '|t2h1=|t2h2=|t2h3=|t2h4=|t2h5=|t2h6=', - bans and (INDENT .. INDENT .. '|t2b1=|t2b2=') or nil, + banBool and (INDENT .. INDENT .. ban2Text) or nil, INDENT .. INDENT .. '|length=|winner=|matchid=|vod=', INDENT .. '}}' ), '\n') end return WikiCopyPaste + From 504e8c7a5f714acc38b960da39a9cf1f60bcb474 Mon Sep 17 00:00:00 2001 From: Corsaka Date: Tue, 1 Sep 2026 18:48:11 +0100 Subject: [PATCH 3/3] @Corsaka feat(match2): fix zero case in deadlock copypaste --- lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua b/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua index 1d62b41bb1c..2d194ad5021 100644 --- a/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua +++ b/lua/wikis/deadlock/GetMatchGroupCopyPaste/wiki.lua @@ -20,7 +20,7 @@ local INDENT = WikiCopyPaste.Indent function WikiCopyPaste.getMatchCode(bestof, mode, index, opponents, args) local showScore = Logic.nilOr(Logic.readBoolOrNil, bestof == 0) - local bans = args.bans + local bans = tonumber(args.bans) local lines = Array.extend( '{{Match|bestof=' .. (bestof ~= 0 and bestof or ''), @@ -43,12 +43,11 @@ end ---@param bans integer ---@return string function WikiCopyPaste._getMapCode(mapIndex, bans) - banBool = true + banBool = false ban1Text = "" ban2Text = "" - if bans == 0 then - banBool = false - else + if bans > 0 then + banBool = true for ban = 1, bans do ban1Text = ban1Text .. "|t1b" .. ban .. "=" ban2Text = ban2Text .. "|t2b" .. ban .. "=" @@ -68,4 +67,3 @@ function WikiCopyPaste._getMapCode(mapIndex, bans) end return WikiCopyPaste -