Drop cart when inventory is filled

This commit is contained in:
SmallJoker 2015-12-23 21:08:29 +01:00
parent 307b5d1f92
commit 73722136a0
1 changed files with 4 additions and 1 deletions

View File

@ -98,8 +98,11 @@ function boost_cart.cart:on_punch(puncher, time_from_last_punch, tool_capabiliti
end
end
local leftover = puncher:get_inventory():add_item("main", "carts:cart")
if not leftover:is_empty() then
minetest.add_item(self.object:getpos(), leftover)
end
self.object:remove()
puncher:get_inventory():add_item("main", "carts:cart")
return
end