Skip to content

Commit

Permalink
Fix: warcraft legacy match maps filterByKey condition (#3799)
Browse files Browse the repository at this point in the history
* Fix: warcraft legacy match maps filterByKey condition

* kick unused require
  • Loading branch information
hjpalpha authored Jan 15, 2024
1 parent 25227d5 commit ebb9f58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/match2/wikis/warcraft/legacy/legacy_match_maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ebb9f58

Please sign in to comment.