1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Drop nodes as items when dugged and no room in inventory and dont remove dropped items when no room in inventory

This commit is contained in:
PilzAdam 2013-01-12 20:18:43 +01:00
parent b29834ab02
commit ef6b8bee07
2 changed files with 13 additions and 2 deletions

View file

@ -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,