Fix issue with Lua 5.2

This commit is contained in:
Foereaper
2023-01-04 00:02:09 +01:00
parent d3aee746ca
commit 5efeca4a96
2 changed files with 4 additions and 4 deletions

View File

@ -51,7 +51,7 @@ local function ParseMessage(str)
local varType = typeTemp[k] local varType = typeTemp[k]
if(varType == 2) then -- Strings if(varType == 2) then -- Strings
-- Special case for empty string parsing -- Special case for empty string parsing
if(v == "") then if(v == string.char(tonumber('1A', 16))) then
v = "" v = ""
end end
elseif(varType == 3) then -- Ints elseif(varType == 3) then -- Ints
@ -79,7 +79,7 @@ local function ProcessVariables(reqId, ...)
if(type(v) == "string") then if(type(v) == "string") then
-- Special case for empty string parsing -- Special case for empty string parsing
if(#v == 0) then if(#v == 0) then
v = "" v = string.char(tonumber('1A', 16))
end end
msg = msg .. delim[2] msg = msg .. delim[2]
elseif(type(v) == "number") then elseif(type(v) == "number") then

View File

@ -53,7 +53,7 @@ local function ParseMessage(str)
local varType = typeTemp[k] local varType = typeTemp[k]
if(varType == 2) then -- strings if(varType == 2) then -- strings
-- special case for empty string parsing -- special case for empty string parsing
if(v == "") then if(v == string.char(tonumber('1A', 16))) then
v = "" v = ""
end end
elseif(varType == 3) then -- Ints elseif(varType == 3) then -- Ints
@ -81,7 +81,7 @@ local function ProcessVariables(sender, reqId, ...)
if(type(v) == "string") then if(type(v) == "string") then
-- Special case for empty string parsing -- Special case for empty string parsing
if(#v == 0) then if(#v == 0) then
v = "" v = string.char(tonumber('1A', 16))
end end
msg = msg .. delim[2] msg = msg .. delim[2]
elseif(type(v) == "number") then elseif(type(v) == "number") then