Skip to content

Commit

Permalink
Actual IsLegal test fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
thecraftianman committed Feb 20, 2024
1 parent e73706b commit bfde36a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lua/acf/core/validation_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@ function ACF.IsLegal(Entity)
if not ACF.LegalChecks then return true end -- Legal checks are disabled

local Phys = Entity:GetPhysicsObject()
local ValidatedPhys = false

if not IsValid(Entity.ACF.PhysObj) then
Entity.ACF.PhysObj = Phys
ValidatedPhys = true
end

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

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

Expand Down

0 comments on commit bfde36a

Please sign in to comment.