mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-29 22:03:42 +01:00
Fix nil crash when recipe item is unknown
This commit is contained in:
parent
f321647a6b
commit
5113dc407a
5
init.lua
5
init.lua
@ -46,7 +46,10 @@ function craftguide:get_tooltip(item, recipe_type, cooktime, groups)
|
|||||||
local fueltime = minetest.get_craft_result({
|
local fueltime = minetest.get_craft_result({
|
||||||
method="fuel", width=1, items={item}}).time
|
method="fuel", width=1, items={item}}).time
|
||||||
local has_extras = groups or recipe_type == "cooking" or fueltime > 0
|
local has_extras = groups or recipe_type == "cooking" or fueltime > 0
|
||||||
local item_desc = groups and "" or minetest.registered_items[item].description
|
local item_desc = ""
|
||||||
|
if minetest.registered_items[item] and not groups then
|
||||||
|
item_desc = minetest.registered_items[item].description
|
||||||
|
end
|
||||||
|
|
||||||
if groups then
|
if groups then
|
||||||
local groupstr = "Any item belonging to the "
|
local groupstr = "Any item belonging to the "
|
||||||
|
Loading…
Reference in New Issue
Block a user