summaryrefslogtreecommitdiff
path: root/callbacks.lua
diff options
context:
space:
mode:
authorHybridDog <ovvv@web.de>2016-02-09 12:00:56 +0100
committerHybridDog <ovvv@web.de>2016-07-15 09:25:23 +0200
commit310ec1da81a51a880221ed01e5ff0dc3d2377cdd (patch)
tree44d618954590725d3d453a632506ac54fed3236b /callbacks.lua
parent1b40a02f1c134e78062bf2139a8d3d1924854ec1 (diff)
Stop flooding connected clients by all detached inventories if freeminer is used, fixes #7
Diffstat (limited to 'callbacks.lua')
-rw-r--r--callbacks.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/callbacks.lua b/callbacks.lua
index 392e855..9387154 100644
--- a/callbacks.lua
+++ b/callbacks.lua
@@ -187,3 +187,11 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
unified_inventory.current_page[player_name])
end)
+if minetest.delete_detached_inventory then
+ minetest.register_on_leaveplayer(function(player)
+ local player_name = player:get_player_name()
+ minetest.delete_detached_inventory(player_name.."_bags")
+ minetest.delete_detached_inventory(player_name.."craftrecipe")
+ minetest.delete_detached_inventory(player_name.."refill")
+ end)
+end