Make items (that are close to the player) dissapear after the time, that is specified by remove_items in minetest.conf

This commit is contained in:
PilzAdam 2012-09-14 17:00:20 +02:00
parent 56a1d32476
commit f77e83e657

View File

@ -85,6 +85,13 @@ function minetest.handle_node_drops(pos, drops, digger)
z = -z
end
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
-- FIXME this doesnt work for deactiveted objects
if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then
minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj)
obj:remove()
end, obj)
end
end
end
end