Quantcast

Don't strip spaces from zone name in slash cmd

James Whitehead II [01-24-11 - 09:04]
Don't strip spaces from zone name in slash cmd

Previously the fuzzy matching was using a gsub on %L to "", which
removed all of the spaces from the user's input. This no longer works
with two word zone names.
Filename
TomTom.lua
diff --git a/TomTom.lua b/TomTom.lua
index 8a398c5..d9eb8ea 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -1157,7 +1157,7 @@ SlashCmdList["TOMTOM_WAY"] = function(msg)

         -- Find a fuzzy match for the zone
         local matches = {}
-        zone = zone:lower():gsub("[%L]", "")
+        zone = zone:lower():gsub("[^%l%s%d]", "")

         for name,mapId in pairs(nameToMapId) do
             local lname = name:lower()