mirror of
https://github.com/mt-mods/currency.git
synced 2024-11-26 06:13: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)
|
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
|
||||||
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)
|
inv:remove_item(list,v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user