Skip to content

Commit

Permalink
visclips checks takes physclips into account
Browse files Browse the repository at this point in the history
  • Loading branch information
MartyX5555 committed Sep 13, 2023
1 parent 69eedb8 commit ec8fb50
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lua/acf/server/sv_acfballistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ function ACF_CheckClips( Ent, HitPos )
local origin

for i = 1, #Ent.ClipData do
normal = Ent:LocalToWorldAngles(Ent.ClipData[i]["n"]):Forward()
origin = Ent:LocalToWorld(Ent:OBBCenter()) + normal * Ent.ClipData[i]["d"]
--debugoverlay.BoxAngles( origin, Vector(0,-24,-24), Vector(1,24,24), Ent:LocalToWorldAngles(Ent.ClipData[i]["n"]), 15, Color(255,0,0,32) )
if normal:Dot((origin - HitPos):GetNormalized()) > 0 then return true end --Since tracehull/traceline transition during impacts, this can be 0 with no issues

local ClipData = Ent.ClipData[i]

normal = Ent:LocalToWorldAngles(ClipData.n):Forward()
origin = Ent:LocalToWorld(Ent:OBBCenter()) + normal * ClipData.d
--debugoverlay.BoxAngles( origin, Vector(0,-24,-24), Vector(1,24,24), Ent:LocalToWorldAngles(ClipData["n"]), 15, Color(255,0,0,32) )
if not ClipData.physics and normal:Dot((origin - HitPos):GetNormalized()) > 0 then return true end --Since tracehull/traceline transition during impacts, this can be 0 with no issues
end

return false

end

do
Expand Down

1 comment on commit ec8fb50

@MartyX5555
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the shell will fully hit the remaining prop even at the area it was cut

Please sign in to comment.