mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
Add comments
This commit is contained in:
parent
ed9d629b99
commit
c37a82d4a2
1 changed files with 3 additions and 0 deletions
|
@ -168,10 +168,13 @@ local land_state_execution = function(self,dtime)
|
|||
|
||||
elseif self.state == "follow" then
|
||||
|
||||
--always look at players
|
||||
mobs.set_yaw_while_following(self)
|
||||
|
||||
--check distance
|
||||
local distance_from_follow_person = vector_distance(self.object:get_pos(), self.following_person:get_pos())
|
||||
|
||||
--don't push the player if too close
|
||||
if self.follow_distance < distance_from_follow_person then
|
||||
mobs.set_mob_animation(self, "run")
|
||||
mobs.set_velocity(self,self.run_velocity)
|
||||
|
|
Loading…
Reference in a new issue