forked from Mineclonia/Mineclonia
Fix crash when clicking craftbook icon in furnace
This commit is contained in:
parent
f7af5dfa07
commit
fb389df3a0
|
@ -1131,25 +1131,6 @@ if progressive_mode then
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mcl_craftguide.show_old(name, item, show_usages)
|
|
||||||
local func = "mcl_craftguide.show(): "
|
|
||||||
assert(name, func .. "player name missing")
|
|
||||||
|
|
||||||
local data = player_data[name]
|
|
||||||
local player = get_player_by_name(name)
|
|
||||||
local query_item = data.query_item
|
|
||||||
|
|
||||||
reset_data(data)
|
|
||||||
|
|
||||||
item = reg_items[item] and item or query_item
|
|
||||||
|
|
||||||
data.query_item = item
|
|
||||||
data.show_usages = show_usages
|
|
||||||
data.recipes = get_recipes(item, data, player)
|
|
||||||
|
|
||||||
show_fs(player, name)
|
|
||||||
end
|
|
||||||
|
|
||||||
function mcl_craftguide.show(name)
|
function mcl_craftguide.show(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
local player = minetest.get_player_by_name(name)
|
||||||
if next(recipe_filters) then
|
if next(recipe_filters) then
|
||||||
|
|
|
@ -20,7 +20,6 @@ local function active_formspec(fuel_percent, item_percent)
|
||||||
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
|
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
|
||||||
"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
|
"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
|
||||||
"tooltip[craftguide;Recipe book]"..
|
"tooltip[craftguide;Recipe book]"..
|
||||||
"tooltip[doc;Help]"..
|
|
||||||
"listring[current_name;dst]"..
|
"listring[current_name;dst]"..
|
||||||
"listring[current_player;main]"..
|
"listring[current_player;main]"..
|
||||||
"listring[current_name;src]"..
|
"listring[current_name;src]"..
|
||||||
|
@ -41,7 +40,6 @@ local inactive_formspec = "size[9,8.75]"..
|
||||||
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||||
"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
|
"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..
|
||||||
"tooltip[craftguide;Recipe book]"..
|
"tooltip[craftguide;Recipe book]"..
|
||||||
"tooltip[doc;Help]"..
|
|
||||||
"listring[current_name;dst]"..
|
"listring[current_name;dst]"..
|
||||||
"listring[current_player;main]"..
|
"listring[current_player;main]"..
|
||||||
"listring[current_name;src]"..
|
"listring[current_name;src]"..
|
||||||
|
@ -51,9 +49,7 @@ local inactive_formspec = "size[9,8.75]"..
|
||||||
|
|
||||||
local receive_fields = function(pos, formname, fields, sender)
|
local receive_fields = function(pos, formname, fields, sender)
|
||||||
if fields.craftguide then
|
if fields.craftguide then
|
||||||
mcl_craftguide.show_craftguide(sender)
|
mcl_craftguide.show(sender:get_player_name())
|
||||||
elseif fields.doc and minetest.get_modpath("doc") then
|
|
||||||
doc.show_entry(sender:get_player_name(), "nodes", "mcl_furnaces:furnace", true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue