From 099b9db187cfd7a175b16a7250cf2e35e3565d8c Mon Sep 17 00:00:00 2001 From: FireSiku Date: Tue, 5 Jun 2018 21:54:35 -0400 Subject: [PATCH] Fix issue where hooks arent delayed properly. Under certain conditions, get_object_from_string could return that a hook needs to be delayed, but also return nil instead of the string. --- vmf/scripts/mods/vmf/modules/core/newhooks.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vmf/scripts/mods/vmf/modules/core/newhooks.lua b/vmf/scripts/mods/vmf/modules/core/newhooks.lua index 88449a0..580966c 100644 --- a/vmf/scripts/mods/vmf/modules/core/newhooks.lua +++ b/vmf/scripts/mods/vmf/modules/core/newhooks.lua @@ -90,10 +90,11 @@ local function get_object_from_string(obj) return obj, true elseif type(obj) == "string" then local obj_table = rawget(_G, obj) - return obj_table, (type(obj_table) == "table") - else - return obj, false + if obj_table then + return obj_table, true + end end + return obj, false end -- VT1 hooked everything using a "Obj.Method" string