wasplib: proper rate limiting for ws.donodes

master
cora 2021-08-31 21:51:35 +02:00
parent 5ffb3b5bb9
commit e62a0bc9c4
1 changed files with 5 additions and 9 deletions

View File

@ -754,15 +754,11 @@ function ws.donodes(poss,func,condition)
if ws.is_laggy() then return end
local dn_i=0
for k,v in pairs(poss) do
local nd=minetest.get_node_or_nil(v)
if nd and nd.name ~= 'air' then
if k > 8 then
return
end
if condition == nil or condition(v) then
func(v)
dn_i = dn_i + 1
end
if dn_i > 8 then return end
--local nd=minetest.get_node_or_nil(v)
if condition == nil or condition(v) then
func(v)
dn_i = dn_i + 1
end
end
end