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>
This commit is contained in:
parent
dcfd31d17a
commit
253a06fa08
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue