From 8e2903be036c19d7fc83838fb8519679cb271ba6 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Fri, 4 Oct 2019 00:52:06 +0200 Subject: [PATCH] Fix messages in craft command --- init.lua | 20 ++++++++------------ locale/template | 3 +-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index 8e60293..394701f 100644 --- a/init.lua +++ b/init.lua @@ -1745,24 +1745,20 @@ function craftguide.show(name, item, show_usages) reset_data(data) item = reg_items[item] and item or query_item + local recipes, usages = get_recipes(item, data, player) - data.query_item = item - data.recipes, data.usages = get_recipes(item, data, player) - - if not data.recipes and not data.usages then - if recipes_cache[item] then - return false, msg(name, S("You don't know a recipe for this node")) - end - - if usages_cache[item] then - return false, msg(name, S("You don't know an usage for this node")) - end - + if not recipes and not usages then if not recipes_cache[item] and not usages_cache[item] then return false, msg(name, S("No recipe or usage for this node")) end + + return false, msg(name, S("You don't know a recipe or usage for this node")) end + data.query_item = item + data.recipes = recipes + data.usages = usages + if sfinv_only then data.show_usages = show_usages end diff --git a/locale/template b/locale/template index 71f932c..9277b23 100644 --- a/locale/template +++ b/locale/template @@ -19,8 +19,7 @@ No item to show= Collect items to reveal more recipes= Show recipe(s) of the pointed node= No node pointed= -You don't know a recipe for this node= -You don't know an usage for this node= +You don't know a recipe or usage for this node= No recipe or usage for this node= Node= Entity=