aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/npcsystem')
-rw-r--r--gamemode/npcsystem/npcs/zombie.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/gamemode/npcsystem/npcs/zombie.lua b/gamemode/npcsystem/npcs/zombie.lua
index 5914c04..ce4105b 100644
--- a/gamemode/npcsystem/npcs/zombie.lua
+++ b/gamemode/npcsystem/npcs/zombie.lua
@@ -88,7 +88,9 @@ 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)
- local dist = ply:GetPos():Distance(self:GetPos())
+ local plypos = ply:GetPos()
+ local mypas = self:GetPos()
+ local dist = plypos:Distance(mypos)
return self.Stats["AwareDist"] - dist
end