Check formname in on_receive_fields

This commit is contained in:
ShadowNinja 2013-12-04 10:43:49 -05:00
parent 3db5f629f2
commit d5f60ed136
2 changed files with 6 additions and 0 deletions

View File

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

View File

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