mirror of
https://github.com/minetest-mods/irc.git
synced 2024-11-05 01:30:19 +01:00
Fixed IRC crashing Minetest
If an IRC client disconnected without a parting message, it crashed the Minetest server. This update fixes that.
This commit is contained in:
parent
66c04438f9
commit
3f42f0660e
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
-- IRC Mod for Minetest
|
-- IRC Mod for Minetest
|
||||||
-- By Diego Martínez <kaeza@users.sf.net>
|
-- By Diego Martínez <kaeza@users.sf.net>
|
||||||
--
|
--
|
||||||
|
@ -148,7 +147,12 @@ end);
|
||||||
|
|
||||||
irc.register_callback("part", function ( servinfo, from, part_msg )
|
irc.register_callback("part", function ( servinfo, from, part_msg )
|
||||||
mt_irc._callback("part", false, from, part_msg);
|
mt_irc._callback("part", false, from, part_msg);
|
||||||
local text = "*** "..from.." left "..mt_irc.channel.." ("..part_msg..")";
|
local text
|
||||||
|
if part_msg then
|
||||||
|
text = "*** "..from.." left "..mt_irc.channel.." ("..part_msg..")";
|
||||||
|
else
|
||||||
|
text = "*** "..from.." left "..mt_irc.channel;
|
||||||
|
end
|
||||||
for k, v in pairs(mt_irc.connected_players) do
|
for k, v in pairs(mt_irc.connected_players) do
|
||||||
if (v) then minetest.chat_send_player(k, text); end
|
if (v) then minetest.chat_send_player(k, text); end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user