mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 03:07:32 +01:00
Don't call minetest.add_item for empty itemstring
This commit is contained in:
parent
d8f3a5ee7f
commit
a31da5efd5
@ -90,6 +90,9 @@ end
|
|||||||
|
|
||||||
local function drop_attached_node(p)
|
local function drop_attached_node(p)
|
||||||
local nn = minetest.get_node(p).name
|
local nn = minetest.get_node(p).name
|
||||||
|
if nn == "air" or nn == "ignore" then
|
||||||
|
return
|
||||||
|
end
|
||||||
minetest.remove_node(p)
|
minetest.remove_node(p)
|
||||||
for _, item in pairs(minetest.get_node_drops(nn, "")) do
|
for _, item in pairs(minetest.get_node_drops(nn, "")) do
|
||||||
local pos = {
|
local pos = {
|
||||||
@ -97,7 +100,9 @@ local function drop_attached_node(p)
|
|||||||
y = p.y + math.random()/2 - 0.25,
|
y = p.y + math.random()/2 - 0.25,
|
||||||
z = p.z + math.random()/2 - 0.25,
|
z = p.z + math.random()/2 - 0.25,
|
||||||
}
|
}
|
||||||
minetest.add_item(pos, item)
|
if item ~= "" then
|
||||||
|
minetest.add_item(pos, item)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user