From b0ba541bce0b9fc6b3d696fe3e7e4bafc2e94eb8 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 29 May 2016 20:43:39 -0400 Subject: Changed if/then statements in zombie to asserts --- gamemode/npcsystem/npcs/zombie.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gamemode/npcsystem') diff --git a/gamemode/npcsystem/npcs/zombie.lua b/gamemode/npcsystem/npcs/zombie.lua index 1075e9d..04e1712 100644 --- a/gamemode/npcsystem/npcs/zombie.lua +++ b/gamemode/npcsystem/npcs/zombie.lua @@ -37,12 +37,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 zombie, checkmele called with null self") - end - if ply == nil then - print("In zombie, 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 -- cgit v1.2.3-70-g09d2