mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-04-30 05:01:41 -04:00
Creative: release memory when player leaves
This commit is contained in:
parent
5a4818a402
commit
c6fabe4734
1 changed files with 5 additions and 0 deletions
|
@ -124,6 +124,11 @@ function creative.update_creative_inventory(player_name, tab_content)
|
|||
inv.size = #creative_list
|
||||
end
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
player_inventory[name] = nil
|
||||
end)
|
||||
|
||||
-- Create the trash field
|
||||
local trash = minetest.create_detached_inventory("trash", {
|
||||
-- Allow the stack to be placed and remove it in on_put()
|
||||
|
|
Loading…
Add table
Reference in a new issue