Compare commits

...

4 Commits

Author SHA1 Message Date
kno10 253a06fa08 Fix mob egg double-spawns (#4657)
If you spawn a mob clicking on a wall, two mobs will be spawned.

To reproduce: face a stack of stones, with a spawn egg click on the side of a stone. It does not happen when you click the top of a node, because spawning below fails and only the second one succeeds.

Reviewed-on: VoxeLibre/VoxeLibre#4657
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <kno10@noreply.git.minetest.land>
Co-committed-by: kno10 <kno10@noreply.git.minetest.land>
2024-09-30 19:21:40 +02:00
kno10 dcfd31d17a Avoid random jumps when standing due to gravity (fewer villagers on the roofs) (#4547)
Reviewed-on: VoxeLibre/VoxeLibre#4547
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: kno10 <erich.schubert@gmail.com>
Co-committed-by: kno10 <erich.schubert@gmail.com>
2024-09-30 11:22:31 +02:00
teknomunk c34aecfcab Don't make 'ignore' nodes break bamboo or kelp (#4551)
This modifies the behavior of kelp and bamboo so that neither breaks when an unloaded node is encountered.

Reviewed-on: VoxeLibre/VoxeLibre#4551
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: teknomunk <teknomunk@protonmail.com>
Co-committed-by: teknomunk <teknomunk@protonmail.com>
2024-09-29 13:57:52 +02:00
Mikita Wiśniewski 9cb4f51468 Fix invalid global call in mcl_chests LBM (#4667)
Reviewed-on: VoxeLibre/VoxeLibre#4667
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: Mikita Wiśniewski <rudzik8@protonmail.com>
Co-committed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
2024-09-29 13:34:20 +02:00
6 changed files with 11 additions and 10 deletions

View File

@ -388,7 +388,7 @@ end
local function on_step_work (self, dtime) local function on_step_work(self, dtime, moveresult)
local pos = self.object:get_pos() local pos = self.object:get_pos()
if not pos then return end if not pos then return end
@ -402,7 +402,7 @@ local function on_step_work (self, dtime)
-- Do we abandon out of here now? -- Do we abandon out of here now?
end end
if self:falling(pos) then return end if self:falling(pos, moveresult) then return end
if self:step_damage (dtime, pos) then return end if self:step_damage (dtime, pos) then return end
if self.state == "die" then return end if self.state == "die" then return end
@ -502,11 +502,11 @@ end
-- main mob function -- main mob function
function mob_class:on_step(dtime) function mob_class:on_step(dtime, moveresult)
if not DEVELOPMENT then if not DEVELOPMENT then
-- Removed as bundled Lua (5.1 doesn't support xpcall) -- Removed as bundled Lua (5.1 doesn't support xpcall)
--local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime) --local status, retVal = xpcall(on_step_work, on_step_error_handler, self, dtime)
local status, retVal = pcall(on_step_work, self, dtime) local status, retVal = pcall(on_step_work, self, dtime, moveresult)
if status then if status then
return retVal return retVal
else else
@ -521,7 +521,7 @@ function mob_class:on_step(dtime)
log_error (dump(retVal), dump(pos), dump(self)) log_error (dump(retVal), dump(pos), dump(self))
end end
else else
return on_step_work (self, dtime) return on_step_work (self, dtime, moveresult)
end end
end end

View File

@ -615,7 +615,7 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad
pos.y = pos.y - 1 pos.y = pos.y - 1
local mob = mcl_mobs.spawn(pos, mob_name) local mob = mcl_mobs.spawn(pos, mob_name)
if not object then if not mob then
pos.y = pos.y + 1 pos.y = pos.y + 1
mob = mcl_mobs.spawn(pos, mob_name) mob = mcl_mobs.spawn(pos, mob_name)
if not mob then return end if not mob then return end

View File

@ -927,7 +927,8 @@ end
-- falling and fall damage -- falling and fall damage
-- returns true if mob died -- returns true if mob died
function mob_class:falling(pos) function mob_class:falling(pos, moveresult)
if moveresult and moveresult.touching_ground then return false end
if self.fly and self.state ~= "die" then if self.fly and self.state ~= "die" then
return return

View File

@ -74,7 +74,7 @@ function mcl_bamboo.break_orphaned(pos)
local node_name = node_below.name local node_name = node_below.name
-- short circuit checks. -- short circuit checks.
if mcl_bamboo.is_dirt(node_name) or mcl_bamboo.is_bamboo(node_name) or mcl_bamboo.is_bamboo(minetest.get_node(pos).name) == false then if node_name == "ignore" or mcl_bamboo.is_dirt(node_name) or mcl_bamboo.is_bamboo(node_name) or mcl_bamboo.is_bamboo(minetest.get_node(pos).name) == false then
return return
end end

View File

@ -79,7 +79,7 @@ minetest.register_lbm({
local node_name = node.name local node_name = node.name
node.name = node_name .. "_small" node.name = node_name .. "_small"
minetest.swap_node(pos, node) minetest.swap_node(pos, node)
select_and_spawn_entity(pos, node) mcl_chests.select_and_spawn_entity(pos, node)
if node_name == "mcl_chests:trapped_chest_on" then if node_name == "mcl_chests:trapped_chest_on" then
minetest.log("action", "[mcl_chests] Disabled active trapped chest on load: " .. minetest.pos_to_string(pos)) minetest.log("action", "[mcl_chests] Disabled active trapped chest on load: " .. minetest.pos_to_string(pos))
mcl_chests.chest_update_after_close(pos) mcl_chests.chest_update_after_close(pos)

View File

@ -196,7 +196,7 @@ function kelp.find_unsubmerged(pos, node, height)
for i=1,height do for i=1,height do
walk_pos.y = y + i walk_pos.y = y + i
local walk_node = mt_get_node(walk_pos) local walk_node = mt_get_node(walk_pos)
if not kelp.is_submerged(walk_node) then if walk_node.name ~= "ignore" and not kelp.is_submerged(walk_node) then
return walk_pos, walk_node, height, i return walk_pos, walk_node, height, i
end end
end end