From c08b42e3f24d8ee274f39ce49fda2add029886d0 Mon Sep 17 00:00:00 2001 From: Apickx Date: Fri, 19 Jan 2018 23:28:46 -0500 Subject: Quick npc fix --- gamemode/npcsystem/npcs/antlion1.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'gamemode/npcsystem') diff --git a/gamemode/npcsystem/npcs/antlion1.lua b/gamemode/npcsystem/npcs/antlion1.lua index 10b9395..5d0bc8e 100644 --- a/gamemode/npcsystem/npcs/antlion1.lua +++ b/gamemode/npcsystem/npcs/antlion1.lua @@ -36,6 +36,7 @@ NPC.IdleSequences = { --Attacks should be formated as [i]={function (return int dammage) canattack(ply) = function doattack(ply)} --NPC will do the most dammage possible per attack local checkmele = function(self, ply) + if (not IsValid(self)) or (not IsValid(ply)) then return -1 end assert(self != nil, "checkmele called on nil npc!") assert(ply != nil, "checkmelecalled for nil player!") if(ply:GetPos():Distance(self:GetPos()) < 100) then return 20 end -- cgit v1.2.3-70-g09d2