From 27360324c3620f123b30acdfaf73667155082022 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 31 Mar 2020 21:28:04 +0200 Subject: [PATCH] Make list_awards show true award name --- mods/awards/api.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/awards/api.lua b/mods/awards/api.lua index a9e0a14..fdda7a8 100644 --- a/mods/awards/api.lua +++ b/mods/awards/api.lua @@ -196,7 +196,7 @@ function awards.give_achievement(name,award) end -- record this in the log - minetest.log("action", name.." Has unlocked"..title..".") + minetest.log("action", "[awards] "..name.." Has unlocked: "..title..".") -- save playertable awards.save() @@ -206,17 +206,18 @@ end -- List a player's achievements minetest.register_chatcommand("list_awards", { params = "", - description = "list_awards: list your awards", + description = "List your awards", func = function(name, param) if not awards.players[name] or not awards.players[name].unlocked then - minetest.chat_send_player(name, "You do not have any awards") + minetest.chat_send_player(name, "You do not have any awards.") return end - minetest.chat_send_player(name, name.."'s awards:") + minetest.chat_send_player(name, "Your awards:") for _, str in pairs(awards.players[name].unlocked) do - minetest.chat_send_player(name, str); + local title = awards.def[award].title + minetest.chat_send_player(name, title) end end, })