diff --git a/lua/pac3/core/client/base_part.lua b/lua/pac3/core/client/base_part.lua index 77867800..15359470 100644 --- a/lua/pac3/core/client/base_part.lua +++ b/lua/pac3/core/client/base_part.lua @@ -61,6 +61,8 @@ function PART:PreInitialize() self.hide_disturbing = false self.active_events = {} self.active_events_ref_count = 0 + local cvarName = "pac_enable_" .. string.Replace(self.ClassName, " ", "_"):lower() + if not GetConVar(cvarName):GetBool() then self:SetWarning("This part class is disabled! Enable it with " .. cvarName .. " 1") end end function PART:Initialize() end diff --git a/lua/pac3/core/client/parts.lua b/lua/pac3/core/client/parts.lua index 29de0987..3fc9157b 100644 --- a/lua/pac3/core/client/parts.lua +++ b/lua/pac3/core/client/parts.lua @@ -89,7 +89,7 @@ function pac.RegisterPart(META) local cvarName = "pac_enable_" .. string.Replace(META.ClassName, " ", "_"):lower() local cvar = CreateClientConVar(cvarName, "1", true) - cvars.AddChangeCallback("pac_enable_" .. META.ClassName, function(name, old, new) + cvars.AddChangeCallback(cvarName, function(name, old, new) local enable = tobool(new) META.GloballyEnabled = enable if enable then