fix jumping up 1 block

This commit is contained in:
TenPlus1 2018-04-27 20:22:55 +01:00
parent f96852775f
commit e4a2706bd6

14
api.lua
View File

@ -3,7 +3,7 @@
mobs = {}
mobs.mod = "redo"
mobs.version = "20180419"
mobs.version = "20180427"
-- Intllib
@ -762,6 +762,15 @@ local do_jump = function(self)
self.object:setvelocity(v)
-- when in air move forward
minetest.after(0.5, function(self, v)
self.object:setvelocity({
x = v.x * 1.5,
y = 0,
z = v.z * 1.5
})
end, self, v)
if get_velocity(self) > 0 then
mob_sound(self, self.sounds.jump)
end
@ -3761,11 +3770,9 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
.. default.gui_bg_img
.. "field[0.5,1;7.5,0;name;" .. minetest.formspec_escape(S("Enter name:")) .. ";" .. tag .. "]"
.. "button_exit[2.5,3.5;3,1;mob_rename;" .. minetest.formspec_escape(S("Rename")) .. "]")
end
return false
end
@ -3812,7 +3819,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- reset external variables
mob_obj[name] = nil
mob_sta[name] = nil
end
end)