diff options
author | ShadowNinja <shadowninja@minetest.net> | 2013-12-04 10:43:49 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2013-12-04 10:43:49 -0500 |
commit | d5f60ed136848e20f5ff620afe2901e246231e0b (patch) | |
tree | 1ed0f15ee36088af8b398a6bb5f0bdfa28c1142f | |
parent | 3db5f629f2e2d524971b7d3d6da9a75c3f853194 (diff) |
Check formname in on_receive_fields
-rw-r--r-- | bags.lua | 3 | ||||
-rw-r--r-- | callbacks.lua | 3 |
2 files changed, 6 insertions, 0 deletions
@@ -48,6 +48,9 @@ for i = 1, 4 do end minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= "" then + return + end for i = 1, 4 do if fields["bag"..i] then local stack = player:get_inventory():get_stack("bag"..i, 1) diff --git a/callbacks.lua b/callbacks.lua index 53601b0..fe76543 100644 --- a/callbacks.lua +++ b/callbacks.lua @@ -49,6 +49,9 @@ minetest.register_on_joinplayer(function(player) end) minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= "" then + return + end local player_name = player:get_player_name() for i, def in pairs(unified_inventory.buttons) do |