Skip to content

Commit

Permalink
style: explicitly name params as playerClientId
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw committed Dec 21, 2023
1 parent 21241b2 commit eb142b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lc-hax/Scripts/Helpers/Players.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static partial class Helper {

public static PlayerControllerB[]? Players => Helper.StartOfRound?.allPlayerScripts;

public static PlayerControllerB? GetPlayer(int playerId) => Helper.Players?.FirstOrDefault(player => player.playerClientId == (ulong)playerId);
public static PlayerControllerB? GetPlayer(int playerClientId) => Helper.Players?.FirstOrDefault(player => player.playerClientId == (ulong)playerClientId);

public static PlayerControllerB? GetPlayer(string username) => Helper.Players?.FirstOrDefault(player => player.playerUsername == username);

Expand All @@ -17,8 +17,8 @@ public static partial class Helper {
? player.isPlayerDead ? null : !player.isPlayerControlled ? null : player
: null;

public static PlayerControllerB? GetActivePlayer(int playerId) =>
Helper.GetPlayer(playerId).IsNotNull(out PlayerControllerB player)
public static PlayerControllerB? GetActivePlayer(int playerClientId) =>
Helper.GetPlayer(playerClientId).IsNotNull(out PlayerControllerB player)
? player.isPlayerDead ? null : !player.isPlayerControlled ? null : player
: null;
}

0 comments on commit eb142b4

Please sign in to comment.