From e1b860c6716c108e7263c1fbd2e71e39ec36e1b6 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 2 Jan 2011 12:02:04 +0000 Subject: [PATCH] Add more robust coordinate parsing support, thanks to Phanx --- TomTom.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TomTom.lua b/TomTom.lua index d2ccef1..62dbf13 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -1133,7 +1133,12 @@ end SLASH_TOMTOM_WAY1 = "/way" SLASH_TOMTOM_WAY2 = "/tway" SLASH_TOMTOM_WAY3 = "/tomtomway" + +local wrongseparator = "(%d)" .. (tonumber("1.1") and "," or ".") .. "(%d)" +local rightseparator = "%1" .. (tonumber("1.1") and "." or ",") .. "%2" + SlashCmdList["TOMTOM_WAY"] = function(msg) + msg = msg:gsub("(%d)[%.,] (%d)", "%1 %2"):gsub(wrongseparator, rightseparator) local tokens = {} for token in msg:gmatch("%S+") do table.insert(tokens, token) end -- 1.7.9.5