fix for material parts on master

lower case and replace spaces in the convar's name
This commit is contained in:
pingu7867 2023-12-19 18:47:53 -05:00 committed by GitHub
parent 44a8e67222
commit 82e0279d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,8 @@ function pac.RegisterPart(META)
assert(istable(META.StorableVars), "Part " .. META.ClassName .. " has no StorableVars")
do
local cvar = CreateClientConVar("pac_enable_" .. META.ClassName, "1", true)
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)
local enable = tobool(new)