forked from mtcontrib/factions
Use onlineplayers table instead.
This commit is contained in:
parent
8d8346939e
commit
279d51037b
@ -510,14 +510,14 @@ function factions.Faction.broadcast(self, msg, sender)
|
|||||||
message = sender.."@"..message
|
message = sender.."@"..message
|
||||||
end
|
end
|
||||||
message = "Faction<"..message
|
message = "Faction<"..message
|
||||||
for k, _ in pairs(self.players) do
|
for k, _ in pairs(self.onlineplayers) do
|
||||||
minetest.chat_send_player(k, message)
|
minetest.chat_send_player(k, message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--! @brief checks whether a faction has at least one connected player
|
--! @brief checks whether a faction has at least one connected player
|
||||||
function factions.Faction.is_online(self)
|
function factions.Faction.is_online(self)
|
||||||
for playername, _ in pairs(self.players) do
|
for playername, _ in pairs(self.onlineplayers) do
|
||||||
if minetest.get_player_by_name(playername) then
|
if minetest.get_player_by_name(playername) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user