aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem/npcs/antlion1.lua
diff options
context:
space:
mode:
authorApickx <apickx@cogarr.com>2018-01-19 23:28:46 -0500
committerApickx <apickx@cogarr.com>2018-01-19 23:28:46 -0500
commitc08b42e3f24d8ee274f39ce49fda2add029886d0 (patch)
treefa30b8342aada1604133ca02c2e3cbac6b6c3290 /gamemode/npcsystem/npcs/antlion1.lua
parentf6a93ea4da3ef008101d155b4c357ee70753ffe8 (diff)
downloadwintersurvival2-c08b42e3f24d8ee274f39ce49fda2add029886d0.tar.gz
wintersurvival2-c08b42e3f24d8ee274f39ce49fda2add029886d0.tar.bz2
wintersurvival2-c08b42e3f24d8ee274f39ce49fda2add029886d0.zip
Quick npc fix
Diffstat (limited to 'gamemode/npcsystem/npcs/antlion1.lua')
-rw-r--r--gamemode/npcsystem/npcs/antlion1.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/gamemode/npcsystem/npcs/antlion1.lua b/gamemode/npcsystem/npcs/antlion1.lua
index 10b9395..5d0bc8e 100644
--- a/gamemode/npcsystem/npcs/antlion1.lua
+++ b/gamemode/npcsystem/npcs/antlion1.lua
@@ -36,6 +36,7 @@ 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 IsValid(self)) or (not IsValid(ply)) then return -1 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