Use onlineplayers table instead.

This commit is contained in:
Coder12a 2018-10-17 21:36:07 -05:00
parent 8d8346939e
commit 279d51037b

View File

@ -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