Skip to content

Commit

Permalink
Lowercase effect before checking blacklist too (#2801)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsturgeon authored Oct 18, 2023
1 parent 7eab44e commit 32a5b8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/entities/gmod_wire_expression2/core/custom/effects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32a5b8e

Please sign in to comment.