mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-08-19 21:04:12 +02:00
Check formname in on_receive_fields
This commit is contained in:
parent
3db5f629f2
commit
d5f60ed136
3
bags.lua
3
bags.lua
@ -48,6 +48,9 @@ for i = 1, 4 do
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
if formname ~= "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
for i = 1, 4 do
|
for i = 1, 4 do
|
||||||
if fields["bag"..i] then
|
if fields["bag"..i] then
|
||||||
local stack = player:get_inventory():get_stack("bag"..i, 1)
|
local stack = player:get_inventory():get_stack("bag"..i, 1)
|
||||||
|
@ -49,6 +49,9 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
if formname ~= "" then
|
||||||
|
return
|
||||||
|
end
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
|
||||||
for i, def in pairs(unified_inventory.buttons) do
|
for i, def in pairs(unified_inventory.buttons) do
|
||||||
|
Loading…
Reference in New Issue
Block a user