From 9afec47237a8d2ff5e3fbc95e1a084cba37e35af Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 18 Jan 2016 20:21:56 -0500 Subject: Modified npc's to not crash when checking attack priority on a nil target --- gamemode/npcsystem/npcs/bird.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'gamemode/npcsystem/npcs/bird.lua') diff --git a/gamemode/npcsystem/npcs/bird.lua b/gamemode/npcsystem/npcs/bird.lua index 48ec71a..af63e76 100644 --- a/gamemode/npcsystem/npcs/bird.lua +++ b/gamemode/npcsystem/npcs/bird.lua @@ -72,6 +72,7 @@ NPC.Target = nil NPC.AwareEnemies = {} --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 0 end local plypos = ply:GetPos() local mypos = self:GetPos() if not plypos then return 0 end -- cgit v1.2.3-70-g09d2