mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-28 11:40:24 +01:00
Bags: Prevent error caused by moving the opened bag
This commit is contained in:
parent
15d729c351
commit
d6d4bea819
5
bags.lua
5
bags.lua
@ -221,6 +221,11 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
on_take = function(inv, listname, index, stack, player)
|
on_take = function(inv, listname, index, stack, player)
|
||||||
player:get_inventory():set_size(listname .. "contents", 0)
|
player:get_inventory():set_size(listname .. "contents", 0)
|
||||||
save_bags_metadata(player, inv)
|
save_bags_metadata(player, inv)
|
||||||
|
if listname == ui.current_page[player:get_player_name()] then
|
||||||
|
-- Bag is currently open: avoid follow-up issues by navigating back
|
||||||
|
-- Trick: the list name is the same as the registered page name
|
||||||
|
ui.set_inventory_formspec(player, "bags")
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
allow_move = function()
|
allow_move = function()
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user