File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
SwiftlyS2.Core/Modules/Players
SwiftlyS2.Shared/Modules/Players Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ public void ClearAllBlockedTransmitEntities()
1818 NativePlayerManager . ClearAllBlockedTransmitEntity ( ) ;
1919 }
2020
21- public IPlayer GetPlayer ( int playerid )
21+ public IPlayer ? GetPlayer ( int playerid )
2222 {
23+ if ( ! IsPlayerOnline ( playerid ) ) return null ;
2324 return new Player ( playerid ) ;
2425 }
2526
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public interface IPlayerManagerService
8484 /// <param name="playerid">The unique identifier of the player to retrieve. Must be a valid player ID.</param>
8585 /// <returns>An <see cref="IPlayer"/> instance representing the player with the specified ID, or <c>null</c> if no such
8686 /// player exists.</returns>
87- public IPlayer GetPlayer ( int playerid ) ;
87+ public IPlayer ? GetPlayer ( int playerid ) ;
8888
8989 /// <summary>
9090 /// Retrieves all players currently online.
You can’t perform that action at this time.
0 commit comments