diff --git a/mods/mobs/init.lua b/mods/mobs/init.lua index c59a1b9..fd14091 100644 --- a/mods/mobs/init.lua +++ b/mods/mobs/init.lua @@ -29,6 +29,7 @@ function mobs.register_mob(name, def) is_visible = true, makes_footstep_sound = false, automatic_rotate = true, + stepheight = 1.1, speed = 0, anim = "", t = 0.0, @@ -90,11 +91,7 @@ function mobs.register_mob(name, def) local p = self.object:getpos() local v = vector.multiply(vector.direction(p, obj_p), 4) local d = obj_p.y - p.y - if d > 0 and d < 2 then - v.y = 2 - else - v.y = (def.gravity or -9.2) - end + v.y = (def.gravity or -9.2) self.object:setvelocity(v) local yaw = math.atan(v.z/v.x)+math.pi/2 diff --git a/mods/pets/init.lua b/mods/pets/init.lua index 139eb9a..1d265cb 100644 --- a/mods/pets/init.lua +++ b/mods/pets/init.lua @@ -26,6 +26,7 @@ function pets.register_pet(name, def) pl = nil, is_pet = false, anim = "stand", + stepheight = 1.1, on_rightclick = function(self, clicker) if not clicker or not clicker:is_player() then @@ -57,18 +58,9 @@ function pets.register_pet(name, def) t.z = t.z + 1.5 if vector.distance(self.object:getpos(), t) > 2 then local vec = vector.direction(self.object:getpos(), t) - --vec.y = vec.y * 10 - if self.object:getpos().y < t.y+0.5 then - vec.y= vec.y + 2 - else - vec.y= -3 - end + vec.y= -3 self.object:setvelocity(vector.multiply(vec, 3)) - local yaw = math.atan(vec.z/vec.x)+math.pi/2 - yaw = yaw+(math.pi/2) - if t.x > t.z then - yaw = yaw+math.pi - end + local yaw = math.atan(vec.z/vec.x) self.object:setyaw(yaw) if def.animations then if self.anim ~= "walk" then