From 7991fc146b116b5afd682119c5a8c055639fc444 Mon Sep 17 00:00:00 2001 From: JetBoom Date: Mon, 20 Oct 2014 07:45:25 -0400 Subject: [PATCH] Fixed rare error in Player.ShouldNotCollide. --- .../zombiesurvival/gamemode/obj_player_extend.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua b/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua index aeae9fa..aa674ba 100644 --- a/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua +++ b/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua @@ -426,11 +426,15 @@ function meta:BarricadeGhostingThink() end function meta:ShouldNotCollide(ent) - if ent:IsPlayer() then - return self:Team() == ent:Team() or self.NoCollideAll or ent.NoCollideAll + if ent:IsValid() then + if ent:IsPlayer() then + return self:Team() == ent:Team() or self.NoCollideAll or ent.NoCollideAll + end + + return self:GetBarricadeGhosting() and ent:IsBarricadeProp() or self:Team() == TEAM_HUMAN and ent:GetPhysicsObject():IsValid() and ent:GetPhysicsObject():HasGameFlag(FVPHYSICS_PLAYER_HELD) end - return self:GetBarricadeGhosting() and ent:IsBarricadeProp() or self:Team() == TEAM_HUMAN and ent:GetPhysicsObject():IsValid() and ent:GetPhysicsObject():HasGameFlag(FVPHYSICS_PLAYER_HELD) + return false end local function nocollidetimer(self, timername)