diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-18 20:21:56 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-18 20:21:56 -0500 |
| commit | 9afec47237a8d2ff5e3fbc95e1a084cba37e35af (patch) | |
| tree | 98a408ba423d0c5bcdf80af1cb14ad08e26e390e /gamemode/npcsystem/npcs/antlion4.lua | |
| parent | 3a01207e64a49566cef2803bebdeda38a5aa5bbc (diff) | |
| download | wintersurvival2-9afec47237a8d2ff5e3fbc95e1a084cba37e35af.tar.gz wintersurvival2-9afec47237a8d2ff5e3fbc95e1a084cba37e35af.tar.bz2 wintersurvival2-9afec47237a8d2ff5e3fbc95e1a084cba37e35af.zip | |
Modified npc's to not crash when checking attack priority on a nil target
Diffstat (limited to 'gamemode/npcsystem/npcs/antlion4.lua')
| -rw-r--r-- | gamemode/npcsystem/npcs/antlion4.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gamemode/npcsystem/npcs/antlion4.lua b/gamemode/npcsystem/npcs/antlion4.lua index 6e2c7be..e8e7a88 100644 --- a/gamemode/npcsystem/npcs/antlion4.lua +++ b/gamemode/npcsystem/npcs/antlion4.lua @@ -111,6 +111,7 @@ NPC.Attacks = { --Attack priority is a fucntion that takes a player, and returns an int describing it's prority to attack (higher = more important) NPC will always attack the player with the highest priority function NPC:AttackPriority(ply) + if not ply then return 0 end local plypos = ply:GetPos() local mypos = self:GetPos() if not plypos then return 0 end |
