mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-27 19:20:27 +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)
|
||||
player:get_inventory():set_size(listname .. "contents", 0)
|
||||
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,
|
||||
allow_move = function()
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user