From 337757f10173c8eb532f6c9e1fdec8dc1f5ecf31 Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 17 Feb 2022 05:04:01 +0400 Subject: [PATCH] #198 Fix a crash, step 23 --- mods/HUD/mcl_inventory/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/HUD/mcl_inventory/init.lua b/mods/HUD/mcl_inventory/init.lua index f59476965..bcdad90d3 100644 --- a/mods/HUD/mcl_inventory/init.lua +++ b/mods/HUD/mcl_inventory/init.lua @@ -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")