From ce57d6570e024e91510196cabf4de42e41f31b95 Mon Sep 17 00:00:00 2001 From: Azumgi Date: Fri, 26 Jan 2018 16:39:27 +0300 Subject: [PATCH] Removed excessive error message (hooking) --- vmf_source/scripts/mods/vmf/modules/hooks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vmf_source/scripts/mods/vmf/modules/hooks.lua b/vmf_source/scripts/mods/vmf/modules/hooks.lua index 37ddde8..6b5cdad 100644 --- a/vmf_source/scripts/mods/vmf/modules/hooks.lua +++ b/vmf_source/scripts/mods/vmf/modules/hooks.lua @@ -9,7 +9,7 @@ HOOKED_FUNCTIONS = HOOKED_FUNCTIONS or {} -- global, because 'loadstring' doesn' local function get_function_by_name(function_name) - local _, value = vmf:pcall(loadstring("return " .. function_name)) + local _, value = pcall(loadstring("return " .. function_name)) -- no need to check status of 'pcall' - if there will be error, it's gonna be string instead of function -- also, it can be anything else instead of function, even if 'loadstring' run will be successful, so check it if type(value) == "function" then