diff --git a/vacuum_tubes.lua b/vacuum_tubes.lua index c1e9fe0..dd3cdd7 100644 --- a/vacuum_tubes.lua +++ b/vacuum_tubes.lua @@ -84,7 +84,9 @@ end local function vacuum(pos, radius) radius = radius + 0.5 + local trueish = false for _, object in pairs(minetest.get_objects_inside_radius(pos, math.sqrt(3) * radius)) do + if trueish == true then return end local lua_entity = object:get_luaentity() if not object:is_player() and lua_entity and lua_entity.name == "__builtin:item" then local obj_pos = object:get_pos() @@ -98,6 +100,7 @@ local function vacuum(pos, radius) lua_entity.itemstring = "" end object:remove() + trueish = true end end end