Fix not walking sheep when player is in view radius

pull/4/head
PilzAdam 2013-05-27 16:16:16 +02:00
parent 0b7ff005d4
commit b3b4e7cd71
1 changed files with 0 additions and 6 deletions

View File

@ -248,22 +248,16 @@ function mobs:register_mob(name, def)
if self.following and self.following:is_player() then
if self.following:get_wielded_item():get_name() ~= self.follow then
self.state = "stand"
self.set_velocity(self, 0)
self.following = nil
self.v_start = false
self:set_animation("stand")
return
end
local s = self.object:getpos()
local p = self.following:getpos()
local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5
if dist > self.view_range then
self.state = "stand"
self.set_velocity(self, 0)
self.following = nil
self.v_start = false
self:set_animation("stand")
return
end