mirror of
https://github.com/minetest-mods/irc.git
synced 2024-12-28 09:40:17 +01:00
Fixed some stupid bugs
This commit is contained in:
parent
9eb893e50a
commit
f19033185b
21
src/init.lua
21
src/init.lua
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user