diff options
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/npcsystem/npcs/antlion1.lua | 8 | ||||
| -rw-r--r-- | gamemode/npcsystem/npcs/antlion2.lua | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/gamemode/npcsystem/npcs/antlion1.lua b/gamemode/npcsystem/npcs/antlion1.lua index 259f108..10b9395 100644 --- a/gamemode/npcsystem/npcs/antlion1.lua +++ b/gamemode/npcsystem/npcs/antlion1.lua @@ -36,12 +36,8 @@ 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 self == nil then - print("In antlion1, checkmele called with null self") - end - if ply == nil then - print("In antlion1, checkmele called with null ply") - 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 return -1 end diff --git a/gamemode/npcsystem/npcs/antlion2.lua b/gamemode/npcsystem/npcs/antlion2.lua index 6c16c72..e60e517 100644 --- a/gamemode/npcsystem/npcs/antlion2.lua +++ b/gamemode/npcsystem/npcs/antlion2.lua @@ -36,12 +36,8 @@ 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 self == nil then - print("In antlion2, checkmele called with null self") - end - if ply == nil then - print("In antlion2, checkmele called with null ply") - 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 return -1 end |
