updated search algorithm
This commit is contained in:
parent
27c96df747
commit
9954e1df80
@ -404,8 +404,14 @@ function buildAvailableWeaknesses(traits)
|
||||
-- split the string into separate traits (separated by "|")
|
||||
local allowedTraits = {}
|
||||
for str in traits:gmatch("([^|]+)") do
|
||||
-- remove dots
|
||||
str = str:gsub("[%.]", "")
|
||||
|
||||
-- remove leading and trailing whitespace
|
||||
str = str:match("^%s*(.-)%s*$")
|
||||
|
||||
-- make sure string ends with a dot
|
||||
str = string.lower(str:gsub("[%.]", "") .. ".")
|
||||
str = string.lower(str .. ".")
|
||||
table.insert(allowedTraits, str)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user