aboutsummaryrefslogtreecommitdiff
path: root/builtin/item.lua
diff options
context:
space:
mode:
authorPilzAdam <PilzAdam@gmx.de>2013-02-13 18:06:25 +0100
committerPilzAdam <PilzAdam@gmx.de>2013-02-13 18:06:25 +0100
commit86b906d015ccde4e8f576a4e61d7c4ae8842b45d (patch)
treecc065d513a88bd66533770faf7b1dc1adaf08413 /builtin/item.lua
parentb1019a88ba9c0822d60d3f4a74d745c69be8a79b (diff)
downloadminetest-86b906d015ccde4e8f576a4e61d7c4ae8842b45d.tar.gz
minetest-86b906d015ccde4e8f576a4e61d7c4ae8842b45d.tar.bz2
minetest-86b906d015ccde4e8f576a4e61d7c4ae8842b45d.zip
Fix minetest.item_place_node() and minetest.item_drop() to always return an ItemStack
Diffstat (limited to 'builtin/item.lua')
-rw-r--r--builtin/item.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/item.lua b/builtin/item.lua
index acbdaa533..2233b6c5b 100644
--- a/builtin/item.lua
+++ b/builtin/item.lua
@@ -141,7 +141,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing)
minetest.log("info", placer:get_player_name() .. " tried to place"
.. " node in invalid position " .. minetest.pos_to_string(above)
.. ", replacing " .. oldnode_above.name)
- return
+ return itemstack
end
-- Place above pointed node
@@ -186,7 +186,7 @@ function minetest.item_place_node(itemstack, placer, pointed_thing)
not check_attached_node(place_to, newnode) then
minetest.log("action", "attached node " .. def.name ..
" can not be placed at " .. minetest.pos_to_string(place_to))
- return
+ return itemstack
end
-- Add node and update
@@ -262,7 +262,7 @@ function minetest.item_drop(itemstack, dropper, pos)
else
minetest.env:add_item(pos, itemstack)
end
- return ""
+ return ItemStack("")
end
function minetest.item_eat(hp_change, replace_with_item)