mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-02-24 21:54:05 +01:00
stop grown child mobs sinking into blocks below
This commit is contained in:
parent
10e4dd92a0
commit
c158e84e28
18
api.lua
18
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210114",
|
version = "20210203",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -1354,11 +1354,15 @@ function mob_class:breed()
|
|||||||
self.on_grown(self)
|
self.on_grown(self)
|
||||||
else
|
else
|
||||||
-- jump when fully grown so as not to fall into ground
|
-- jump when fully grown so as not to fall into ground
|
||||||
self.object:set_velocity({
|
-- self.object:set_velocity({
|
||||||
x = 0,
|
-- x = 0,
|
||||||
y = self.jump_height,
|
-- y = self.jump_height,
|
||||||
z = 0
|
-- z = 0
|
||||||
})
|
-- })
|
||||||
|
local pos = self.object:get_pos() ; if not pos then return end
|
||||||
|
local ent = self.object:get_luaentity()
|
||||||
|
pos.y = pos.y + (ent.collisionbox[2] * -1) - 0.4
|
||||||
|
self.object:set_pos(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1458,6 +1462,8 @@ function mob_class:breed()
|
|||||||
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5)
|
effect(pos, 15, "tnt_smoke.png", 1, 2, 2, 15, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pos.y = pos.y + 0.5 -- spawn child a little higher
|
||||||
|
|
||||||
local mob = minetest.add_entity(pos, self.name)
|
local mob = minetest.add_entity(pos, self.name)
|
||||||
local ent2 = mob:get_luaentity()
|
local ent2 = mob:get_luaentity()
|
||||||
local textures = self.base_texture
|
local textures = self.base_texture
|
||||||
|
Loading…
x
Reference in New Issue
Block a user