adjustments to cachedplayer handling

This commit is contained in:
rootdarkarchon
2023-02-15 14:23:06 +01:00
parent 73f009757c
commit eed44f090d
12 changed files with 303 additions and 178 deletions

View File

@@ -63,7 +63,7 @@ public class PairManager : MediatorSubscriberBase, IDisposable
}
public List<Pair> OnlineUserPairs => _allClientPairs.Where(p => !string.IsNullOrEmpty(p.Value.PlayerNameHash)).Select(p => p.Value).ToList();
public List<UserData> VisibleUsers => _allClientPairs.Where(p => p.Value.CachedPlayer != null && p.Value.CachedPlayer.IsVisible).Select(p => p.Key).ToList();
public List<UserData> VisibleUsers => _allClientPairs.Where(p => p.Value.CachedPlayer?.PlayerName != null).Select(p => p.Key).ToList();
public Pair? LastAddedUser { get; internal set; }
@@ -273,7 +273,7 @@ public class PairManager : MediatorSubscriberBase, IDisposable
private void DalamudUtilOnDelayedFrameworkUpdate()
{
foreach (var player in _allClientPairs.Select(p => p.Value).Where(p => p.CachedPlayer != null && p.CachedPlayer.IsVisible).ToList())
foreach (var player in _allClientPairs.Select(p => p.Value).Where(p => p.CachedPlayer?.PlayerName != null).ToList())
{
if (!player.CachedPlayer!.CheckExistence())
{