Make each vacuuming tube only vacuum one entity per second (may help tubes not to break)
This commit is contained in:
parent
8b1b92370f
commit
cd772281f9
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user