1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-12-24 01:30:22 +01:00

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