1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-07-04 09:00:22 +02:00

fixed npc follow|stop if tamed, consume not diamond

mobs follow but rest at distance
comment code
This commit is contained in:
2015-07-14 20:27:36 +02:00
parent bbc295355c
commit c366a481ea
2 changed files with 21 additions and 18 deletions

View File

@ -467,7 +467,7 @@ function mobs:register_mob(name, def)
end
end
if self.type == "npc" and self.order == "follow" and self.owner and self.owner ~= "" and self.state ~= "attack" then
if self.type == "npc" and self.order == "follow" and self.owner and self.owner ~= "" and self.state ~= "attack" then --/MFF (Crabman|07/14/2015) follow diamond if has not owner
-- npc stop following player if not owner
if self.following and self.owner and self.owner ~= self.following:get_player_name() then
self.following = nil
@ -503,7 +503,7 @@ function mobs:register_mob(name, def)
self.object:setyaw(yaw)
-- anyone but standing npc's can move along
if dist > 2 and self.order ~= "stand" then
if dist > 4 and self.order ~= "stand" then --/MFF (Crabman|07/14/2015) follow but at distance
if (self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0)
or (self.object:getvelocity().y == 0 and self.jump_chance > 0) then
self.direction = {x = math.sin(yaw)*-1, y = -20, z = math.cos(yaw)}