From bd7f1c6bfbc2b9928d1905db2f9ca6b9710d0c70 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 12 Nov 2020 19:46:04 +0100 Subject: [PATCH] 7816_error - fix number to hex conversion (thanks @vortix) --- client/lualibs/7816_error.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/lualibs/7816_error.lua b/client/lualibs/7816_error.lua index 2ddf04133..34f9847ce 100644 --- a/client/lualibs/7816_error.lua +++ b/client/lualibs/7816_error.lua @@ -71,7 +71,8 @@ _errorcodes.tostring = function(command) return ("%s (%s)"):format(_reverse_lookup[command] or "ERROR UNDEFINED!", command) end if(type(command) == 'number') then - return ("%s (%d)"):format(_reverse_lookup[ tostring(command)] or "ERROR UNDEFINED!", command) + local hx = ("%04X"):format(command) + return ("%s (0x%s)"):format(_reverse_lookup[hx] or "ERROR UNDEFINED!", hx) end return ("Error, numeric or string argument expected, got : %s"):format(tostring(command)) end