Actually disable PlayerWatcher if it is unused, and stop iterations on Clear().

This commit is contained in:
Ottermandias 2021-08-11 12:40:36 +02:00
parent 9666909e87
commit 557d03861f
2 changed files with 48 additions and 13 deletions

View file

@ -25,13 +25,16 @@ namespace Penumbra.PlayerWatch
}
public void Enable()
=> Active = Valid;
=> SetStatus( true );
public void Disable()
=> Active = false;
=> SetStatus( false );
public void SetStatus( bool enabled )
=> Active = enabled && Valid;
{
Active = enabled && Valid;
_playerWatch?.CheckActiveStatus();
}
internal void Trigger( Actor actor )
=> ActorChanged?.Invoke( actor );