From d21f5b34033488eeb3cb9ca11e093b8b0643478d Mon Sep 17 00:00:00 2001 From: kaeza Date: Wed, 23 Oct 2013 01:23:02 -0200 Subject: [PATCH] Fix wrong check for common service and bot suffixes. --- src/chatcmds.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chatcmds.lua b/src/chatcmds.lua index 0c6dead..badf28f 100644 --- a/src/chatcmds.lua +++ b/src/chatcmds.lua @@ -19,14 +19,15 @@ minetest.register_chatcommand("irc_msg", { minetest.chat_send_player(name, "Invalid usage, see /help irc_msg.") return end + local toname_l = toname:lower() local validNick = false for nick, user in pairs(mt_irc.conn.channels[mt_irc.config.channel].users) do - if nick:lower() == toname:lower() then + if nick:lower() == toname_l then validNick = true break end end - if toname:find("Serv|Bot") then + if toname_l:find("serv$") or toname_l:find("bot$") then validNick = false end if not validNick then