diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2018-04-27 20:22:55 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2018-04-27 20:22:55 +0100 |
commit | e4a2706bd694862a1886011b89b317987b680b5d (patch) | |
tree | 773140212f28a769bc2e16ed94cc3477092f7600 | |
parent | f96852775fccedf1fedc2c716c7d10756bb099ba (diff) |
fix jumping up 1 block
-rw-r--r-- | api.lua | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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) |