From 1ed92b161d4eb16cfdfa8bf25b3c51e46a0dedce Mon Sep 17 00:00:00 2001 From: Brandon Sturgeon Date: Tue, 17 Oct 2023 23:05:35 -0700 Subject: [PATCH] Lowercase effect before checking blacklist too --- lua/entities/gmod_wire_expression2/core/custom/effects.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/custom/effects.lua b/lua/entities/gmod_wire_expression2/core/custom/effects.lua index e5d5c29e60..b335ffb608 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/effects.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/effects.lua @@ -170,8 +170,10 @@ end e2function void effect:play(string name) if not this then return self:throw("Invalid effect!", nil) end if not isAllowed(self) then return self:throw("Effect play() burst limit reached!", nil) end + + name = name:lower() if effect_blacklist[name] then return self:throw("This effect is blacklisted!", nil) end - if hook.Run( "Expression2_CanEffect", name:lower(), self ) == false then return self:throw("A hook prevented this function from running", nil) end + if hook.Run( "Expression2_CanEffect", name, self ) == false then return self:throw("A hook prevented this function from running", nil) end fire(self, this, name) end