1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-04-13 06:20:22 +02:00

Creative: release memory when player leaves

This commit is contained in:
Maksym H. 2024-12-25 05:18:05 +01:00 committed by sfan5
parent 5a4818a402
commit c6fabe4734

View File

@ -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()