aboutsummaryrefslogtreecommitdiff
path: root/shop.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-03-06 00:49:07 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-03-06 00:49:07 +0100
commit32a6dd0e587a8db860f6889807b238924bc0fda1 (patch)
tree5cd8368adc951761df1956b7129d8a7595a01992 /shop.lua
parent8305e5970f3c74d7b132f73443df0b083a15d7ef (diff)
downloadcurrency-32a6dd0e587a8db860f6889807b238924bc0fda1.tar.gz
currency-32a6dd0e587a8db860f6889807b238924bc0fda1.tar.bz2
currency-32a6dd0e587a8db860f6889807b238924bc0fda1.zip
Add Smacker bank note, Prevent Shop Banach-Tarski
Diffstat (limited to 'shop.lua')
-rw-r--r--shop.lua9
1 files changed, 5 insertions, 4 deletions
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