From 52ec95b64ec88db05fa7df17d667aaa23cbdbfcd Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 1 May 2011 19:11:34 +0100 Subject: [PATCH] Fix fuzzy zone matching This ensures that 'Icecrown' will match 'Icecrown', whereas 'Icec' will match both 'Icecrown' and 'Icecrown Citadel'. In short, an exact match will automatically be accepted. --- TomTom.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index 3c49ba2..b6704c7 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -1124,7 +1124,11 @@ SlashCmdList["TOMTOM_WAY"] = function(msg) for name, mapId in pairs(nameToMapId) do local lname = lowergsub(name) - if lname:match(lzone) then + if lname == lzone then + -- We have an exact match + matches = {name} + break + elseif lname:match(lzone) then table.insert(matches, name) end end @@ -1196,7 +1200,11 @@ SlashCmdList["TOMTOM_WAY"] = function(msg) for name,mapId in pairs(nameToMapId) do local lname = lowergsub(name) - if lname:match(lzone) then + if lname == lzone then + -- We have an exact match + matches = {name} + break + elseif lname:match(lzone) then table.insert(matches, name) end end -- 1.7.9.5