Fixed some stupid bugs

This commit is contained in:
Diego Martínez 2013-03-28 07:41:24 -03:00
parent 9eb893e50a
commit f19033185b
1 changed files with 7 additions and 14 deletions

View File

@ -61,25 +61,17 @@ mt_irc.part = function ( name )
minetest.chat_send_player(name, "IRC: You are not in the channel."); minetest.chat_send_player(name, "IRC: You are not in the channel.");
return; return;
end end
mt_irc.connected_players[name] = false; mt_irc.connected_players[name] = nil;
minetest.chat_send_player(name, "IRC: You are now out of the channel."); minetest.chat_send_player(name, "IRC: You are now out of the channel.");
--irc.send(mt_irc.channel, name.." is no longer in the channel.");
irc.send(name.." is no longer in the channel.");
end end
mt_irc.join = function ( name ) mt_irc.join = function ( name )
local function do_join ( name ) if (mt_irc.connected_players[name]) then
if (mt_irc.connected_players[name]) then minetest.chat_send_player(name, "IRC: You are already in the channel.");
minetest.chat_send_player(name, "IRC: You are already in the channel."); return;
return;
end
mt_irc.connected_players[name] = true;
mt_irc.join(mt_irc.channel);
minetest.chat_send_player(name, "IRC: You are now in the channel.");
end
if (not pcall(do_join, name)) then
mt_irc.connected_players[name] = false;
end end
mt_irc.connected_players[name] = true;
minetest.chat_send_player(name, "IRC: You are now in the channel.");
end end
mt_irc.connect = function ( ) mt_irc.connect = function ( )
@ -107,6 +99,7 @@ mt_irc.connect = function ( )
for _,player in ipairs(minetest.get_connected_players()) do for _,player in ipairs(minetest.get_connected_players()) do
mt_irc.connected_players[player:get_player_name()] = mt_irc.auto_join; mt_irc.connected_players[player:get_player_name()] = mt_irc.auto_join;
end end
mt_irc.players_connected = true;
end end
mt_irc.cur_time = mt_irc.cur_time + dtime; mt_irc.cur_time = mt_irc.cur_time + dtime;
if (mt_irc.cur_time >= mt_irc.dtime) then if (mt_irc.cur_time >= mt_irc.dtime) then