From 43cf0d8e7e5701d976a5b7b01bdf0194aa783295 Mon Sep 17 00:00:00 2001 From: whosit <138972279+yl-whosit@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:40:40 +0300 Subject: [PATCH] Fix error when clicking unknown item in the recipe (#255) --- register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/register.lua b/register.lua index f802a71..f2b689e 100644 --- a/register.lua +++ b/register.lua @@ -329,7 +329,7 @@ ui.register_page("craftguide", { local giveme_form = "label[" .. (give_x + 0.1) .. "," .. (craftguidey + 2.7) .. ";" .. F(S("Give me:")) .. "]" .. "button[" .. (give_x) .. "," .. (craftguidey + 2.9) .. ";0.75,0.5;craftguide_giveme_1;1]" - if item_def.type ~= "tool" then + if item_def and item_def.type ~= "tool" then giveme_form = giveme_form .. "button[" .. (give_x + 0.8) .. "," .. (craftguidey + 2.9) .. ";0.75,0.5;craftguide_giveme_10;10]" .. "button[" .. (give_x + 1.6) .. "," .. (craftguidey + 2.9) .. ";0.75,0.5;craftguide_giveme_99;99]"