Avoid crash on 81 line

This commit is contained in:
Zemtzov7 2023-08-12 18:37:41 +05:00 committed by GitHub
parent 33f48379a7
commit 533bbeb5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
number = key:gsub("item:","")
end
local inv = core.get_inventory({type="player", name=target[name]})
if not inv then return end
local lists = inv:get_lists()
local ilist = genlist(lists)
local stack = inv:get_list(ilist[(tab[name] or 1)])[tonumber(number)]