mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-28 04:23:01 +00:00
Mobs can't jump while already in air
This commit is contained in:
parent
bdd0123c77
commit
fd5f3a8df7
1 changed files with 4 additions and 3 deletions
|
@ -1292,12 +1292,13 @@ local do_jump = function(self)
|
||||||
if self.walk_chance == 0
|
if self.walk_chance == 0
|
||||||
or minetest.registered_items[nod.name].walkable then
|
or minetest.registered_items[nod.name].walkable then
|
||||||
|
|
||||||
if minetest.get_item_group(nod.name, "fence") == 0
|
local v = self.object:get_velocity()
|
||||||
|
|
||||||
|
if v.y == 0
|
||||||
|
and minetest.get_item_group(nod.name, "fence") == 0
|
||||||
and minetest.get_item_group(nod.name, "fence_gate") == 0
|
and minetest.get_item_group(nod.name, "fence_gate") == 0
|
||||||
and minetest.get_item_group(nod.name, "wall") == 0 then
|
and minetest.get_item_group(nod.name, "wall") == 0 then
|
||||||
|
|
||||||
local v = self.object:get_velocity()
|
|
||||||
|
|
||||||
v.y = self.jump_height
|
v.y = self.jump_height
|
||||||
|
|
||||||
set_animation(self, "jump") -- only when defined
|
set_animation(self, "jump") -- only when defined
|
||||||
|
|
Loading…
Reference in a new issue