From ebb9f58cd69d041fa4fd2e7605d1a790f1d7392b Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Mon, 15 Jan 2024 11:01:34 +0100 Subject: [PATCH] Fix: warcraft legacy match maps filterByKey condition (#3799) * Fix: warcraft legacy match maps filterByKey condition * kick unused require --- .../match2/wikis/warcraft/legacy/legacy_match_maps.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/match2/wikis/warcraft/legacy/legacy_match_maps.lua b/components/match2/wikis/warcraft/legacy/legacy_match_maps.lua index 674b3fa7d57..2d184b6facd 100644 --- a/components/match2/wikis/warcraft/legacy/legacy_match_maps.lua +++ b/components/match2/wikis/warcraft/legacy/legacy_match_maps.lua @@ -15,7 +15,6 @@ local Logic = require('Module:Logic') local Match = require('Module:Match') local MatchGroup = require('Module:MatchGroup') local PageVariableNamespace = require('Module:PageVariableNamespace') -local String = require('Module:StringUtils') local Table = require('Module:Table') local Template = require('Module:Template') @@ -121,7 +120,9 @@ function LegacyMatchMaps._readMaps(args) for mapIndex = 1, MAX_NUM_MAPS do local prefix = 'map' .. mapIndex - local map = Table.filterByKey(args, function(key) return String.startsWith(key, prefix) end) + local map = Table.filterByKey(args, function(key) + return key == prefix or string.find(key, '^' .. prefix .. '[^%d]') + end) map = Table.map(map, function(key, value) args[key] = nil