From d0ff9e332a5046ea93f4e0bc9e1075961e4dec08 Mon Sep 17 00:00:00 2001 From: Anand S Date: Mon, 12 Nov 2018 20:45:55 +0530 Subject: [PATCH] Fix /rankings not returning text output --- mods/ctf_stats/gui.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/ctf_stats/gui.lua b/mods/ctf_stats/gui.lua index 5995f5e..d4d5da5 100644 --- a/mods/ctf_stats/gui.lua +++ b/mods/ctf_stats/gui.lua @@ -235,8 +235,8 @@ local function send_as_chat_result(to, name) if place < 1 then place = #players + 1 end - local you_are_in = (to == name) and "You are in " or name .. " is in " - local result = you_are_in .. place .. " place." + local you_are_in = (to == name) and "You are in " or name .. " is in " + local result = you_are_in .. place .. " place.\n" if me then local kd = me.kills if me.deaths > 1 then @@ -245,10 +245,10 @@ local function send_as_chat_result(to, name) result = result .. "Kills: " .. me.kills .. " | Deaths: " .. me.deaths .. " | K/D: " .. math.floor(kd * 10) / 10 .. - " | Bounty kills: " .. me.bounty_kills .. + "\nBounty kills: " .. me.bounty_kills .. " | Captures: " .. me.captures .. " | Attempts: " .. me.attempts .. - " | Score: " .. math.floor(me.score) + "\nScore: " .. math.floor(me.score) end return true, result end @@ -270,7 +270,7 @@ minetest.register_chatcommand("rankings", { end if not minetest.get_player_by_name(name) then - send_as_chat_result(name, target) + return send_as_chat_result(name, target) else local players = {} for pname, pstat in pairs(ctf_stats.players) do