From b0e3cca02bb0376ad766e80bd5f56d6d689691a8 Mon Sep 17 00:00:00 2001 From: James Whitehead Ii Date: Tue, 25 Mar 2008 11:15:32 +0000 Subject: [PATCH] Fixed the parsing of the description part of the slash comman --- TomTom.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index 7ec1cd1..9008192 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -725,11 +725,12 @@ end SLASH_WAY1 = "/way" SlashCmdList["WAY"] = function(msg) - msg = msg:lower() - local tokens = {} for token in msg:gmatch("%S+") do table.insert(tokens, token) end + -- Lower the first token + tokens[1] = tokens[1]:lower() + if tokens[1] == "reset" then if tokens[2] == "all" then StaticPopup_Show("TOMTOM_REMOVE_ALL_CONFIRM") @@ -776,6 +777,7 @@ SlashCmdList["WAY"] = function(msg) elseif tokens[1] and not tonumber(tokens[1]) then -- This is a waypoint set, with a zone before the coords local zone,x,y,desc = unpack(tokens) + if desc then desc = table.concat(tokens, " ", 4) end -- Find a fuzzy match for the zone local matches = {} @@ -811,6 +813,9 @@ SlashCmdList["WAY"] = function(msg) elseif not y or not tonumber(y) then return usage() end + if desc then + desc = table.concat(tokens, " ", 3) + end x = tonumber(x) y = tonumber(y) -- 1.7.9.5