Skip to content

Commit

Permalink
Update ranking_commands.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT authored Jan 11, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1a37628 commit 3f6988b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mods/ctf/ctf_modebase/ranking_commands.lua
Original file line number Diff line number Diff line change
@@ -182,6 +182,10 @@ ctf_core.register_chatcommand_alias("donate", "d", {

dmessage = (dmessage and dmessage ~= "") and (": " .. dmessage) or ""

if #dmessage > 50 then
return false, "The donation message is " .. (#dmessage - 50) .. " chars too long!"
end

current_mode.recent_rankings.add(name, {score=-scoretotal}, true)
local names = ""
for pname, team in pairs(pnames) do
@@ -201,11 +205,6 @@ ctf_core.register_chatcommand_alias("donate", "d", {
donate_timer[name] = os.time()
local donate_text = string.format("%s donated %s score to %s%s", name, score, names, dmessage)

if #donate_text > 50 then
minetest.chat_send_player(name, minetest.colorize("#FF0000", "Error: Your message is too long!"))
return false
end

minetest.chat_send_all(minetest.colorize("#00EEFF", donate_text))
ctf_modebase.announce(donate_text)
return true

0 comments on commit 3f6988b

Please sign in to comment.