Use same TSPlayer.Active check

This commit is contained in:
SGKoishi 2022-12-12 17:15:34 -08:00
parent c6b60e22d7
commit 59f9440d17
No known key found for this signature in database
GPG key ID: 8FFC399070653828
4 changed files with 12 additions and 12 deletions

View file

@ -172,7 +172,7 @@ namespace TShockAPI
foreach (TSPlayer player in TShock.Players)
{
if (player != null && player != excludedPlayer && player.Active && player.HasPermission(Permissions.logs) &&
player.DisplayLogs && TShock.Config.Settings.DisableSpewLogs == false)
player.DisplayLogs && !TShock.Config.Settings.DisableSpewLogs)
player.SendMessage(log, color);
}
}
@ -183,7 +183,7 @@ namespace TShockAPI
/// <returns>The number of active players on the server.</returns>
public int GetActivePlayerCount()
{
return Main.player.Where(p => null != p && p.active).Count();
return TShock.Players.Count(p => null != p && p.Active);
}
//Random should not be generated in a method