summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstujones11 <stujones111@gmail.com>2016-01-24 17:54:02 +0000
committerstujones11 <stujones111@gmail.com>2016-01-24 17:54:02 +0000
commitfc6b10eb660c237f5953485a2ee45d175db3361c (patch)
treea1aed282616f7b97ee45b211f53759d2b9ceda9b
parent616261cc839b46ff1d23523359273e07cdffee0c (diff)
Disallow pick-up if cart contains items
-rw-r--r--railcart/init.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/railcart/init.lua b/railcart/init.lua
index d9b543b..2cd9586 100644
--- a/railcart/init.lua
+++ b/railcart/init.lua
@@ -68,6 +68,11 @@ minetest.register_entity("railcart:cart_entity", {
if puncher:get_player_control().sneak then
if self.cart then
if self.cart.id then
+ if self.cart.inv then
+ if not self.cart.inv:is_empty("main") then
+ return
+ end
+ end
railcart:remove_cart(self.cart.id)
end
end