Skip to content

Commit

Permalink
Fix IsLegal tests FOR REAL
Browse files Browse the repository at this point in the history
Wtf is the deal with this bug
  • Loading branch information
thecraftianman committed Feb 20, 2024
1 parent 985c035 commit 86c54a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/acf/core/validation_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ function ACF.IsLegal(Entity)
if not ACF.LegalChecks then return true end -- Legal checks are disabled

local Phys = Entity:GetPhysicsObject()
local ValidPhys = IsValid(Entity.ACF.PhysObj)

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

if Entity.ACF.PhysObj ~= Phys then
if ValidPhys and Entity.ACF.PhysObj ~= Phys then
if Phys:GetVolume() then
Entity.ACF.PhysObj = Phys -- Updated PhysObj
else
Expand Down

0 comments on commit 86c54a8

Please sign in to comment.