From fc6b10eb660c237f5953485a2ee45d175db3361c Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sun, 24 Jan 2016 17:54:02 +0000 Subject: Disallow pick-up if cart contains items --- railcart/init.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'railcart/init.lua') 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 -- cgit v1.2.3