Update PlayerWatcher to deal with multiple actors with the same name.

This commit is contained in:
Ottermandias 2021-10-11 11:50:59 +02:00
parent 0b8a3d2d11
commit b6304d43db
4 changed files with 75 additions and 37 deletions

View file

@ -86,12 +86,12 @@ namespace Penumbra.PlayerWatch
return _playerWatch!.UpdatePlayerWithoutEvent( actor );
}
public IEnumerable< (string, CharacterEquipment) > WatchedPlayers()
public IEnumerable< (string, (uint, CharacterEquipment)[]) > WatchedPlayers()
{
CheckValidity();
return _playerWatch!.Equip
.Where( kvp => kvp.Value.Item2.Contains( this ) )
.Select( kvp => ( kvp.Key, kvp.Value.Item1 ) );
.Where( kvp => kvp.Value.RegisteredWatchers.Contains( this ) )
.Select( kvp => ( kvp.Key, kvp.Value.FoundActors.Select( kvp2 => ( kvp2.Key, kvp2.Value ) ).ToArray() ) );
}
}