Skip to content
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.

Commit

Permalink
Fix following
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockMen committed May 10, 2014
1 parent a23c5ae commit 6fda104
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ function creatures.follow(self, items, radius)
end
end
if quit then return end
NPC = current_pos
PLAYER = object:getpos()
self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z}
self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2
if PLAYER.x > NPC.x then
self.yaw = self.yaw + math.pi
end
self.yaw = self.yaw - 2
self.object:setyaw(self.yaw)
self.feeder = object
end
NPC = current_pos
PLAYER = object:getpos()
self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z}
self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2
if PLAYER.x > NPC.x then
self.yaw = self.yaw + math.pi
end
self.yaw = self.yaw - 2
self.object:setyaw(self.yaw)
self.feeder = object
end
end
end
Expand Down

0 comments on commit 6fda104

Please sign in to comment.