Faster item spawn check

master
Wuzzy 2018-09-13 22:43:00 +02:00
parent 38cbf84ce6
commit 8a0ee8d414
1 changed files with 4 additions and 2 deletions

View File

@ -1134,19 +1134,21 @@ minetest.register_node("tutorial:itemspawner", {
end
end
end
else
return
end
spawned = meta:get_int("spawned")
if spawned ~= 1 then
if itemstring ~= nil and itemstring ~= "" then
minetest.add_item(spawnpos, itemstring)
local timer = minetest.get_node_timer(pos)
timer:start(5)
timer:start(1)
return
end
end
local timer = minetest.get_node_timer(pos)
timer:start(5)
timer:start(1)
end,
})