1
0
mirror of https://github.com/minetest-mods/irc.git synced 2024-12-27 09:10:21 +01:00

Fix error if @ with no name is used.

This commit is contained in:
Diego Martínez 2017-02-16 02:38:44 -03:00
parent 33542b07fe
commit 78fbe26a2c

View File

@ -41,7 +41,9 @@ function irc:bot_command(msg, text)
text = text:match("^%s*(.*)")
if text:sub(1, 1) == "@" then
local _, _, player_to, message = text:find("^.([^%s]+)%s(.+)$")
if not minetest.get_player_by_name(player_to) then
if not player_to then
return
elseif not minetest.get_player_by_name(player_to) then
irc:reply("User '"..player_to.."' is not in the game.")
return
elseif not irc.joined_players[player_to] then