1
0
mirror of https://github.com/SmallJoker/boost_cart.git synced 2024-12-25 02:10:19 +01:00

Drop cart when inventory is filled

This commit is contained in:
SmallJoker 2015-12-23 21:08:29 +01:00
parent 307b5d1f92
commit 73722136a0

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