Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ACF.GlobalFilter #389

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions lua/acf/core/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ do -- ACF global vars
npc_strider = true,
npc_dog = true,
phys_bone_follower = true,
acf_armor = not ACF.AllowProcArmor, -- Procedural armor filter
}

-- Ammo
Expand Down
3 changes: 2 additions & 1 deletion lua/acf/core/utilities/traces_sh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ do -- ACF.trace

util.TraceLine(traceData)

if Output.HitNonWorld and ACF.CheckClips(Output.Entity, Output.HitPos) then
-- Check for clips or to filter this entity
if Output.HitNonWorld and (ACF.CheckClips(Output.Entity, Output.HitPos) or ACF.GlobalFilter[Output.Entity:GetClass()]) then
local OldFilter = traceData.filter
local Filter = { Output.Entity }

Expand Down
2 changes: 2 additions & 0 deletions lua/acf/damage/explosion_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local TraceData = {
filter = true,
mask = MASK_SOLID,
}
local GlobalFilter = ACF.GlobalFilter

--- Checks whether an entity can be affected by ACF explosions.
-- @param Entity The entity to be checked.
Expand All @@ -22,6 +23,7 @@ function Damage.isValidTarget(Entity)
local Type = ACF.Check(Entity)

if not Type then return false end
if GlobalFilter[Entity:GetClass()] then return false end
if Entity.Exploding then return false end
if Type ~= "Squishy" then return true end

Expand Down
Loading