Item_names: Free table entry on player leave

This commit is contained in:
SmallJoker 2017-05-29 19:28:04 +02:00
parent 945ab7f55b
commit 20f1c5c3c2

View File

@ -33,6 +33,10 @@ minetest.register_on_joinplayer(function(player)
minetest.after(0, set_hud, player) minetest.after(0, set_hud, player)
end) end)
minetest.register_on_leaveplayer(function(player)
item_names[player:get_player_name()] = nil
end)
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
for _, player in pairs(minetest.get_connected_players()) do for _, player in pairs(minetest.get_connected_players()) do
local data = item_names[player:get_player_name()] local data = item_names[player:get_player_name()]