#198 Fix a crash, step 23

This commit is contained in:
kay27 2022-02-17 05:04:01 +04:00
parent 5f25f0d1a6
commit 337757f101
1 changed files with 2 additions and 1 deletions

View File

@ -8,7 +8,7 @@ mcl_inventory = {}
-- Returns a single itemstack in the given inventory to the main inventory, or drop it when there's no space left
function return_item(itemstack, dropper, pos, inv)
if dropper:is_player() then
if mcl_util and mcl_util.is_player(dropper) then
-- Return to main inventory
if inv:room_for_item("main", itemstack) then
inv:add_item("main", itemstack)
@ -130,6 +130,7 @@ end
-- Drop items in craft grid and reset inventory on closing
minetest.register_on_player_receive_fields(function(player, formname, fields)
if not mcl_util or not mcl_util.is_player(player) then return end
if fields.quit then
return_fields(player,"craft")
return_fields(player,"enchanting_lapis")