From dceb48bf947a7222868102043e2f392e3b1b84d7 Mon Sep 17 00:00:00 2001 From: kabou Date: Thu, 5 May 2022 01:06:26 +0200 Subject: [PATCH] Fix undefined variable in mcl_enchanting/engine.lua. --- mods/ITEMS/mcl_enchanting/engine.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_enchanting/engine.lua b/mods/ITEMS/mcl_enchanting/engine.lua index 11a98ed4ff..c2f979010b 100644 --- a/mods/ITEMS/mcl_enchanting/engine.lua +++ b/mods/ITEMS/mcl_enchanting/engine.lua @@ -457,10 +457,10 @@ function mcl_enchanting.generate_random_table_slots(itemstack, num_bookshelves) end function mcl_enchanting.get_table_slots(player, itemstack, num_bookshelves) - if (not mcl_enchanting.can_enchant_freshly(itemstack:get_name())) or mcl_enchanting.not_enchantable_on_enchanting_table(itemname) then + local itemname = itemstack:get_name() + if (not mcl_enchanting.can_enchant_freshly(itemname)) or mcl_enchanting.not_enchantable_on_enchanting_table(itemname) then return {false, false, false} end - local itemname = itemstack:get_name() local meta = player:get_meta() local player_slots = minetest.deserialize(meta:get_string("mcl_enchanting:slots")) or {} local player_bookshelves_slots = player_slots[num_bookshelves] or {}