diff options
Diffstat (limited to 'code/ui/PlayerInfo.razor')
| -rw-r--r-- | code/ui/PlayerInfo.razor | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/code/ui/PlayerInfo.razor b/code/ui/PlayerInfo.razor index 2acdef0..fed61c0 100644 --- a/code/ui/PlayerInfo.razor +++ b/code/ui/PlayerInfo.razor @@ -26,12 +26,13 @@ playerinfo { {
public string GetTeamColour()
{
- var ClientPawn = Game.LocalPawn;
- if (ClientPawn is Player)
+ var clientPawn = Game.LocalPawn;
+ if (clientPawn is Player {Camera: not null } player)
{
- return TeamOperations.GetTeamColour(((Player)ClientPawn).CurrentTeam);
+ var colour = TeamOperations.GetTeamColour(player.Camera.GetObservedTeam());
+ return string.IsNullOrWhiteSpace(colour) ? "white" : colour;
}
- return "";
+ return "white";
}
protected override int BuildHash()
|
