diff --git a/mods/HUD/awards/chat_commands.lua b/mods/HUD/awards/chat_commands.lua index 7ae15755e6..88af4962bd 100644 --- a/mods/HUD/awards/chat_commands.lua +++ b/mods/HUD/awards/chat_commands.lua @@ -20,14 +20,15 @@ minetest.register_chatcommand("awards", { params = S("[c|clear|disable|enable]"), description = S("Show, clear, disable or enable your advancements."), func = function(name, param) + if awards.player(name).disabled then + minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!")) + return + end + if param == "clear" then - if awards.player(name).disabled ~= nil then - minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!")) - else - awards.clear_player(name) - minetest.chat_send_player(name, - S("All your awards and statistics have been cleared. You can now start again.")) - end + awards.clear_player(name) + minetest.chat_send_player(name, + S("All your awards and statistics have been cleared. You can now start again.")) elseif param == "disable" then awards.disable(name) minetest.chat_send_player(name, S("You have disabled your advancements.")) @@ -35,17 +36,9 @@ minetest.register_chatcommand("awards", { awards.enable(name) minetest.chat_send_player(name, S("You have enabled your advancements.")) elseif param == "c" then - if awards.player(name).disabled ~= nil then - minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!")) - else - awards.show_to(name, name, nil, true) - end + awards.show_to(name, name, nil, true) else - if awards.player(name).disabled ~= nil then - minetest.chat_send_player(name, S("Awards are disabled, enable them first by using /awards enable!")) - else - awards.show_to(name, name, nil, false) - end + awards.show_to(name, name, nil, false) end end })