Safe hooks are now truly safe: Handler functions are xpcall'd

This commit is contained in:
FireSiku 2018-06-08 15:53:38 -04:00
parent 0380e9f4a8
commit dd31894cd2

View file

@ -161,7 +161,7 @@ local function create_specialized_hook(self, orig, handler, hook_type)
elseif hook_type == HOOK_TYPE_SAFE then
func = function(...)
if hook_data.active then
return handler(...)
vmf.xpcall_no_return_values(self, "(safe_hook)", handler, ...)
end
end
else