From e37f1df6d3442c882ffa5d0deac86cb810a6b823 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 10 Feb 2019 20:37:24 +0100 Subject: [PATCH] Fix error message in progressive mode --- init.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 7dc8411..26577f0 100644 --- a/init.lua +++ b/init.lua @@ -941,9 +941,10 @@ mt.register_chatcommand("craft", { end end + local red = mt.colorize("red", "[craftguide] ") + if not node_name then - return false, mt.colorize("red", "[craftguide] ") .. - S("No node pointed") + return false, red .. S("No node pointed") end local data = player_data[name] @@ -957,15 +958,18 @@ mt.register_chatcommand("craft", { end if not recipes or #recipes == 0 then + local ylw = mt.colorize("yellow", node_name) + local msg = red .. "%s: " .. ylw + if is_fuel then recipes = get_item_usages(node_name) if #recipes > 0 then data.show_usages = true end + elseif recipes_cache[node_name] then + return false, fmt(msg, S("You don't know a recipe for this node")) else - return false, mt.colorize("red", "[craftguide] ") .. - S("No recipe for this node:") .. " " .. - mt.colorize("yellow", node_name) + return false, fmt(msg, S("No recipe for this node")) end end