Permalink
Browse files

Update vehicle 3rd person camera trace filter

Missed this file.
  • Loading branch information...
1 parent e7111a4 commit 725505d2f3391f26200fe28e8561d3e0c5fa552e @robotboy655 robotboy655 committed Jan 20, 2015
Showing with 5 additions and 4 deletions.
  1. +5 −4 garrysmod/gamemodes/base/gamemode/cl_init.lua
@@ -320,15 +320,16 @@ function GM:CalcVehicleView( Vehicle, ply, view )
local tr = util.TraceHull( {
start = view.origin,
endpos = TargetOrigin,
- filter = function()
- return false
+ filter = function( e )
+ local c = e:GetClass() -- Avoid contact with entities that can potentially be attached to the vehicle. Ideally, we should check if "e" is constrained to "Vehicle".
+ return !c:StartWith( "prop_physics" ) && !c:StartWith( "prop_ragdoll" ) && !e:IsVehicle() && !c:StartWith( "gmod_" )
end,
mins = Vector( -WallOffset, -WallOffset, -WallOffset ),
maxs = Vector( WallOffset, WallOffset, WallOffset ),
} )
- view.origin = tr.HitPos
- view.drawviewer = true
+ view.origin = tr.HitPos
+ view.drawviewer = true
--
-- If the trace hit something, put the camera there.

0 comments on commit 725505d

Please sign in to comment.