Merge remote-tracking branch 'mcl2/master' into testing

This commit is contained in:
kay27 2021-12-10 03:47:25 +04:00
commit 06b482b309
2 changed files with 8 additions and 6 deletions

View File

@ -31,6 +31,7 @@ local spawn_children_on_die = function(child_mob, children_count, spawn_distance
speed_penalty = 0.5
end
local mob = minetest.add_entity(newpos, child_mob)
if mob then
if (not mother_stuck) then
mob:set_velocity(vector.multiply(dir, eject_speed * speed_penalty))
end
@ -38,6 +39,7 @@ local spawn_children_on_die = function(child_mob, children_count, spawn_distance
table.insert(children, mob)
angle = angle + (math.pi*2)/children_count
end
end
-- If mother was murdered, children attack the killer after 1 second
if self.state == "attack" then
minetest.after(1.0, function(children, enemy)

View File

@ -350,7 +350,7 @@ minetest.register_abm({
local inv = meta:get_inventory()
for _,object in pairs(minetest.get_objects_inside_radius(pos, 2)) do
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and not object:get_luaentity()._removed then
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
-- Item must get sucked in when the item just TOUCHES the block above the hopper
-- This is the reason for the Y calculation.