mirror of
https://github.com/mt-mods/currency.git
synced 2024-11-22 12:23:44 +01:00
drop items from barter table if no room in inventory
This commit is contained in:
parent
99b98dd00a
commit
1d2cb7cf15
@ -67,7 +67,11 @@ barter.chest.give_inventory = function(inv,list,playername)
|
||||
player = minetest.get_player_by_name(playername)
|
||||
if player then
|
||||
for k,v in ipairs(inv:get_list(list)) do
|
||||
player:get_inventory():add_item("main",v)
|
||||
if player:get_inventory():room_for_item("main",v) then
|
||||
player:get_inventory():add_item("main",v)
|
||||
else
|
||||
minetest.add_item(player:get_pos(),v)
|
||||
end
|
||||
inv:remove_item(list,v)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user