diff options
| author | Apickx <apickx@cogarr.com> | 2018-01-19 23:28:46 -0500 |
|---|---|---|
| committer | Apickx <apickx@cogarr.com> | 2018-01-19 23:28:46 -0500 |
| commit | c08b42e3f24d8ee274f39ce49fda2add029886d0 (patch) | |
| tree | fa30b8342aada1604133ca02c2e3cbac6b6c3290 | |
| parent | f6a93ea4da3ef008101d155b4c357ee70753ffe8 (diff) | |
| download | wintersurvival2-c08b42e3f24d8ee274f39ce49fda2add029886d0.tar.gz wintersurvival2-c08b42e3f24d8ee274f39ce49fda2add029886d0.tar.bz2 wintersurvival2-c08b42e3f24d8ee274f39ce49fda2add029886d0.zip | |
Quick npc fix
| -rw-r--r-- | gamemode/npcsystem/npcs/antlion1.lua | 1 |
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 |
