From 7cef367ab340e39afe69f9b61203e11bfd2dce44 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 25 Mar 2016 23:39:10 -0400 Subject: Updates to fences, and ai --- gamemode/npcsystem/npcs/antlion1.lua | 6 ++++++ gamemode/npcsystem/npcs/antlion2.lua | 6 ++++++ gamemode/npcsystem/npcs/zombie.lua | 6 ++++++ 3 files changed, 18 insertions(+) (limited to 'gamemode/npcsystem') diff --git a/gamemode/npcsystem/npcs/antlion1.lua b/gamemode/npcsystem/npcs/antlion1.lua index 2c3d908..3e90e19 100644 --- a/gamemode/npcsystem/npcs/antlion1.lua +++ b/gamemode/npcsystem/npcs/antlion1.lua @@ -36,6 +36,12 @@ 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 self then + print("In antlion1, checkmele called with null self") + end + if not ply then + print("In antlion1, checkmele called with null ply") + end if(ply:GetPos():Distance(self:GetPos()) < 100) then return 20 end return -1 end diff --git a/gamemode/npcsystem/npcs/antlion2.lua b/gamemode/npcsystem/npcs/antlion2.lua index 5b53b8e..28154cc 100644 --- a/gamemode/npcsystem/npcs/antlion2.lua +++ b/gamemode/npcsystem/npcs/antlion2.lua @@ -36,6 +36,12 @@ 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 self then + print("In antlion2, checkmele called with null self") + end + if not ply then + print("In antlion2, checkmele called with null ply") + end if(ply:GetPos():Distance(self:GetPos()) < 100) then return 20 end return -1 end diff --git a/gamemode/npcsystem/npcs/zombie.lua b/gamemode/npcsystem/npcs/zombie.lua index 41dad0f..e62b833 100644 --- a/gamemode/npcsystem/npcs/zombie.lua +++ b/gamemode/npcsystem/npcs/zombie.lua @@ -37,6 +37,12 @@ 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 self then + print("In zombie, checkmele called with null self") + end + if not ply then + print("In zombie, checkmele called with null ply") + end if(ply:GetPos():Distance(self:GetPos()) < 100) then return 20 end return -1 end -- cgit v1.2.3-70-g09d2