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:
parent
307b5d1f92
commit
73722136a0
5
init.lua
5
init.lua
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user