mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
Change signalcall to protectedcall in console
Even though they kind of do the same (calling function in protected mode), @edubart suggested to use a different function for the sake of readability.
This commit is contained in:
@@ -296,6 +296,16 @@ function numbertoboolean(number)
|
||||
end
|
||||
end
|
||||
|
||||
function protectedcall(func, ...)
|
||||
local status, ret = pcall(func, ...)
|
||||
if status then
|
||||
return ret
|
||||
end
|
||||
|
||||
perror(ret)
|
||||
return false
|
||||
end
|
||||
|
||||
function signalcall(param, ...)
|
||||
if type(param) == 'function' then
|
||||
local status, ret = pcall(param, ...)
|
||||
|
Reference in New Issue
Block a user