Skip to content

Commit

Permalink
Fix valid check on BP
Browse files Browse the repository at this point in the history
  • Loading branch information
marchc1 committed Jun 20, 2024
1 parent f2d6704 commit 2d79051
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lua/acf/scanner/scanner_sh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1151,12 +1151,16 @@ if CLIENT then
if not IsValid(ent) then return end
local mi, ma
if not IsValid(ent:GetPhysicsObject()) then
mi = ent2bp[ent][1]
ma = ent2bp[ent][2]
if mi == nil or ma == nil then return end
if ent2bp[ent] then
mi = ent2bp[ent][1]
ma = ent2bp[ent][2]
end
else
mi, ma = ent:GetPhysicsObject():GetAABB()
end

if mi == nil or ma == nil then return end

render.SetColorMaterial()
render.DepthRange(0, 0.01)
render.DrawBox(ent:GetPos(), ent:GetAngles(), mi, ma, scanDef.colorBoundsInside)
Expand Down

0 comments on commit 2d79051

Please sign in to comment.