aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-29 20:43:39 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-29 20:43:39 -0400
commitb0ba541bce0b9fc6b3d696fe3e7e4bafc2e94eb8 (patch)
tree79861a11e2e7b60641edea77f1354b12f2828038 /gamemode/npcsystem
parent64571b36f7616ef541eb6a33e7fbd5bfa6bbdde3 (diff)
downloadwintersurvival2-b0ba541bce0b9fc6b3d696fe3e7e4bafc2e94eb8.tar.gz
wintersurvival2-b0ba541bce0b9fc6b3d696fe3e7e4bafc2e94eb8.tar.bz2
wintersurvival2-b0ba541bce0b9fc6b3d696fe3e7e4bafc2e94eb8.zip
Changed if/then statements in zombie to asserts
Diffstat (limited to 'gamemode/npcsystem')
-rw-r--r--gamemode/npcsystem/npcs/zombie.lua8
1 files changed, 2 insertions, 6 deletions
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