From 8fd4dbbcef2460dc1eed4733fdc8991583230222 Mon Sep 17 00:00:00 2001 From: FireSiku Date: Sat, 15 Dec 2018 21:59:35 -0500 Subject: [PATCH] hooks: Do not log hook state for mods that do not hook anything. --- vmf/scripts/mods/vmf/modules/core/hooks.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmf/scripts/mods/vmf/modules/core/hooks.lua b/vmf/scripts/mods/vmf/modules/core/hooks.lua index 760cfeb..172878e 100644 --- a/vmf/scripts/mods/vmf/modules/core/hooks.lua +++ b/vmf/scripts/mods/vmf/modules/core/hooks.lua @@ -350,7 +350,9 @@ end local function toggle_all_hooks_for_mod(mod, enabled_state) local toggle_status = (enabled_state and "Enabling") or "Disabling" - mod:info("(hooks): %s all hooks for mod: %s", toggle_status, mod:get_name()) + if next(_registry[mod]) then + mod:info("(hooks): %s all hooks for mod: %s", toggle_status, mod:get_name()) + end for _, hook_data in pairs(_registry[mod]) do hook_data.active = enabled_state end