From 2d79051ad1f79341d0eac0683261fe1fca653a34 Mon Sep 17 00:00:00 2001 From: march <106459595+marchc1@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:37:34 -0700 Subject: [PATCH] Fix valid check on BP --- lua/acf/scanner/scanner_sh.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/acf/scanner/scanner_sh.lua b/lua/acf/scanner/scanner_sh.lua index 4b42d593..cb501f8f 100644 --- a/lua/acf/scanner/scanner_sh.lua +++ b/lua/acf/scanner/scanner_sh.lua @@ -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)