diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-29 20:42:56 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-29 20:42:56 -0400 |
| commit | 64571b36f7616ef541eb6a33e7fbd5bfa6bbdde3 (patch) | |
| tree | cf6feebed99a1da82cbcdb37b6fc84eb273882a8 /gamemode/npcsystem | |
| parent | af7ee9e0e69e4f8f0a09f2795f5cde14e738a8b1 (diff) | |
| download | wintersurvival2-64571b36f7616ef541eb6a33e7fbd5bfa6bbdde3.tar.gz wintersurvival2-64571b36f7616ef541eb6a33e7fbd5bfa6bbdde3.tar.bz2 wintersurvival2-64571b36f7616ef541eb6a33e7fbd5bfa6bbdde3.zip | |
Changed if/then statements in antlions 1 and 2 to asserts
Diffstat (limited to 'gamemode/npcsystem')
| -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 |
