diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-10 21:10:03 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-10 21:10:03 -0500 |
| commit | 31641879af7d32f1570b59bb5d27a193ed0931c3 (patch) | |
| tree | 65799bc24214382c26ee212b460a6b84ace5b8e9 /gamemode/npcsystem/npcs/zombie.lua | |
| parent | 312f321f771960872fb3ee3e1bb24ebaf91aa38f (diff) | |
| download | wintersurvival2-31641879af7d32f1570b59bb5d27a193ed0931c3.tar.gz wintersurvival2-31641879af7d32f1570b59bb5d27a193ed0931c3.tar.bz2 wintersurvival2-31641879af7d32f1570b59bb5d27a193ed0931c3.zip | |
Fixed npc's breaking when they don't have an initial target
Diffstat (limited to 'gamemode/npcsystem/npcs/zombie.lua')
| -rw-r--r-- | gamemode/npcsystem/npcs/zombie.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gamemode/npcsystem/npcs/zombie.lua b/gamemode/npcsystem/npcs/zombie.lua index ce4105b..b4718a4 100644 --- a/gamemode/npcsystem/npcs/zombie.lua +++ b/gamemode/npcsystem/npcs/zombie.lua @@ -90,6 +90,7 @@ NPC.Attacks = { function NPC:AttackPriority(ply)
local plypos = ply:GetPos()
local mypas = self:GetPos()
+ if not plypos then return 0 end
local dist = plypos:Distance(mypos)
return self.Stats["AwareDist"] - dist
end
|
