apply fix from lifo's fork

thanks Blockhead ❤️
This commit is contained in:
BuckarooBanzay 2022-08-09 17:53:44 +02:00
parent f74ee653b8
commit 664eec36e6

@ -344,13 +344,14 @@ minetest.register_on_player_receive_fields(function(sender, formname, fields)
end end
end end
if can_exchange then if can_exchange then
local it
for i, item in pairs(wants) do for i, item in pairs(wants) do
pinv:remove_item("customer_gives",item) it = pinv:remove_item("customer_gives",item)
minv:add_item("customers_gave",item) minv:add_item("customers_gave",it)
end end
for i, item in pairs(gives) do for i, item in pairs(gives) do
minv:remove_item("stock",item) it = minv:remove_item("stock",item)
pinv:add_item("customer_gets",item) pinv:add_item("customer_gets",it)
end end
minetest.chat_send_player(name, S("Exchanged!")) minetest.chat_send_player(name, S("Exchanged!"))
check_stock( check_stock(