Fixed rare error in Player.ShouldNotCollide.

This commit is contained in:
JetBoom 2014-10-20 07:45:25 -04:00
parent 50f5cefdee
commit 7991fc146b

View file

@ -426,11 +426,15 @@ function meta:BarricadeGhostingThink()
end end
function meta:ShouldNotCollide(ent) function meta:ShouldNotCollide(ent)
if ent:IsValid() then
if ent:IsPlayer() then if ent:IsPlayer() then
return self:Team() == ent:Team() or self.NoCollideAll or ent.NoCollideAll return self:Team() == ent:Team() or self.NoCollideAll or ent.NoCollideAll
end end
return self:GetBarricadeGhosting() and ent:IsBarricadeProp() or self:Team() == TEAM_HUMAN and ent:GetPhysicsObject():IsValid() and ent:GetPhysicsObject():HasGameFlag(FVPHYSICS_PLAYER_HELD) return self:GetBarricadeGhosting() and ent:IsBarricadeProp() or self:Team() == TEAM_HUMAN and ent:GetPhysicsObject():IsValid() and ent:GetPhysicsObject():HasGameFlag(FVPHYSICS_PLAYER_HELD)
end
return false
end end
local function nocollidetimer(self, timername) local function nocollidetimer(self, timername)