mirror of
https://github.com/mt-mods/currency.git
synced 2024-08-20 04:24:08 +02: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)
|
player = minetest.get_player_by_name(playername)
|
||||||
if player then
|
if player then
|
||||||
for k,v in ipairs(inv:get_list(list)) do
|
for k,v in ipairs(inv:get_list(list)) do
|
||||||
|
if player:get_inventory():room_for_item("main",v) then
|
||||||
player:get_inventory():add_item("main",v)
|
player:get_inventory():add_item("main",v)
|
||||||
|
else
|
||||||
|
minetest.add_item(player:get_pos(),v)
|
||||||
|
end
|
||||||
inv:remove_item(list,v)
|
inv:remove_item(list,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user