Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
thecraftianman committed Feb 20, 2024
2 parents d2fe282 + cdeb576 commit 8eea514
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions lua/acf/core/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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
4 changes: 2 additions & 2 deletions lua/acf/core/validation_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function ACF.IsLegal(Entity)

local Phys = Entity:GetPhysicsObject()

if Entity.ACF.PhysObj ~= Phys then
if not IsValid(Entity.ACF.PhysObj) or Entity.ACF.PhysObj ~= Phys then
if Phys:GetVolume() then
Entity.ACF.PhysObj = Phys -- Updated PhysObj
else
Expand Down Expand Up @@ -196,7 +196,7 @@ function ACF.Check(Entity, ForceUpdate) -- IsValid but for ACF
end

ACF.Activate(Entity)
elseif ForceUpdate or Entity.ACF.Mass ~= PhysObj:GetMass() or Entity.ACF.PhysObj ~= PhysObj then
elseif ForceUpdate or Entity.ACF.Mass ~= PhysObj:GetMass() or (not IsValid(Entity.ACF.PhysObj) or Entity.ACF.PhysObj ~= PhysObj) then
ACF.Activate(Entity, true)
end

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

0 comments on commit 8eea514

Please sign in to comment.