From d5729b8a325102a839869d04cdd2491ff2327cff Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 31 May 2018 14:34:19 +0200 Subject: [PATCH] Fix load-crash if _magnet_timer of item entity is uninizialized --- mods/ENTITIES/mcl_item_entity/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index ef3f6c17a3..f3e02a0c3c 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -61,7 +61,7 @@ minetest.register_globalstep(function(dtime) --magnet and collection for _,object in ipairs(minetest.get_objects_inside_radius(checkpos, item_drop_settings.radius_magnet)) do - if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then + if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" and object:get_luaentity()._magnet_timer and (object:get_luaentity()._insta_collect or (object:get_luaentity().age > item_drop_settings.age)) then object:get_luaentity()._magnet_timer = object:get_luaentity()._magnet_timer + dtime local collected = false if object:get_luaentity()._magnet_timer >= 0 and object:get_luaentity()._magnet_timer < item_drop_settings.magnet_time and inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then