Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lua/entities/gmod_wire_expression2/core/custom/effects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ E2Lib.RegisterExtension("effects", false, "Allows E2s to play arbitrary effects.
local wire_expression2_effect_burst_max = CreateConVar("wire_expression2_effect_burst_max", 4, FCVAR_ARCHIVE)
local wire_expression2_effect_burst_rate = CreateConVar("wire_expression2_effect_burst_rate", 0.1, FCVAR_ARCHIVE)

-- Use hook Expression2_CanEffect to blacklist/whitelist effects
-- Use hook Expression2_CanEffect(name, e2, is_play) to blacklist/whitelist effects
local effect_blacklist = {
dof_node = true
}
Expand Down Expand Up @@ -169,7 +169,7 @@ e2function void effect:play(string name)

name = name:lower()
if effect_blacklist[name] then return self:throw("This effect is blacklisted!", nil) end
if hook.Run("Expression2_CanEffect", name, self) == false then return self:throw("A hook prevented this function from running", nil) end
if hook.Run("Expression2_CanEffect", name, self, true) == false then return self:throw("A hook prevented this function from running", nil) end

fire(self, this, name)
end
Expand All @@ -181,7 +181,7 @@ end
e2function number effectCanPlay(string name)
if not isAllowed(self) then return 0 end
if effect_blacklist[name] then return 0 end
if hook.Run("Expression2_CanEffect", name:lower(), self) == false then return 0 end
if hook.Run("Expression2_CanEffect", name:lower(), self, false) == false then return 0 end

return 1
end
Expand Down
Loading