From 32a6dd0e587a8db860f6889807b238924bc0fda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Fri, 6 Mar 2020 00:49:07 +0100 Subject: Add Smacker bank note, Prevent Shop Banach-Tarski --- shop.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'shop.lua') diff --git a/shop.lua b/shop.lua index 301a08c..2cbb94f 100644 --- a/shop.lua +++ b/shop.lua @@ -195,13 +195,14 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields) end end if can_exchange then + local it for i, item in pairs(wants) do - pinv:remove_item("customer_gives",item) - minv:add_item("customers_gave",item) + it = pinv:remove_item("customer_gives",item) + minv:add_item("customers_gave",it) end for i, item in pairs(gives) do - minv:remove_item("stock",item) - pinv:add_item("customer_gets",item) + it = minv:remove_item("stock",item) + pinv:add_item("customer_gets",it) end minetest.chat_send_player(name,S("Exchanged!")) else -- cgit v1.2.3