From 4d9d034503dac45eea6da1e32da7fa8b2e97ea6a Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 7 Mar 2016 18:44:21 -0500 Subject: Fixed npc's bugging out (hopefully) --- gamemode/npcsystem/npcs/zombie.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gamemode/npcsystem/npcs/zombie.lua') diff --git a/gamemode/npcsystem/npcs/zombie.lua b/gamemode/npcsystem/npcs/zombie.lua index c18083e..de4a389 100644 --- a/gamemode/npcsystem/npcs/zombie.lua +++ b/gamemode/npcsystem/npcs/zombie.lua @@ -88,7 +88,7 @@ NPC.Attacks = { --Attack priority is a fucntion that takes a player, and returns an int describing it's prority to attack (higher = more important) NPC will always attack the player with the highest priority function NPC:AttackPriority(ply) - if not ply then return end + if not ply or not ply:IsValid() then return end local plypos = ply:GetPos() local mypos = self:GetPos() if not plypos then return 0 end -- cgit v1.2.3-70-g09d2