aboutsummaryrefslogtreecommitdiff
path: root/builtin/item_entity.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/item_entity.lua')
-rw-r--r--builtin/item_entity.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/item_entity.lua b/builtin/item_entity.lua
index 46415e538..1699cb03c 100644
--- a/builtin/item_entity.lua
+++ b/builtin/item_entity.lua
@@ -109,7 +109,10 @@ minetest.register_entity("__builtin:item", {
on_punch = function(self, hitter)
if self.itemstring ~= '' then
- hitter:get_inventory():add_item("main", self.itemstring)
+ local left = hitter:get_inventory():add_item("main", self.itemstring)
+ if not left:is_empty() then
+ return
+ end
end
self.object:remove()
end,