From 253a06fa08aef02116d5fe06549c349aa7da330c Mon Sep 17 00:00:00 2001 From: kno10 Date: Mon, 30 Sep 2024 19:21:40 +0200 Subject: [PATCH] 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: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4657 Reviewed-by: the-real-herowl Co-authored-by: kno10 Co-committed-by: kno10 --- mods/ENTITIES/mcl_mobs/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index 74e6edbec..d8f8491d5 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -615,7 +615,7 @@ function mcl_mobs.register_egg(mob_id, desc, background_color, overlay_color, ad pos.y = pos.y - 1 local mob = mcl_mobs.spawn(pos, mob_name) - if not object then + if not mob then pos.y = pos.y + 1 mob = mcl_mobs.spawn(pos, mob_name) if not mob then return end