aboutsummaryrefslogtreecommitdiffstats
path: root/code/ui/team
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2023-07-30 19:12:09 +0100
committerLeonardo Bishop <me@leonardobishop.com>2023-07-30 19:12:09 +0100
commit4ae38adb208c435ff6a021cdd0517768c5314fe6 (patch)
tree18ccbffd5fd3d385983ba41f3cd0031586995733 /code/ui/team
parent970e3de202b1482ae72b85487414d9b933818774 (diff)
Add observed health and team colours to spectator mode
Diffstat (limited to 'code/ui/team')
-rw-r--r--code/ui/team/TeamInfo.razor6
1 files changed, 3 insertions, 3 deletions
diff --git a/code/ui/team/TeamInfo.razor b/code/ui/team/TeamInfo.razor
index 883dcf0..4451810 100644
--- a/code/ui/team/TeamInfo.razor
+++ b/code/ui/team/TeamInfo.razor
@@ -22,10 +22,10 @@
public string GetTeamName()
{
- var ClientPawn = Game.LocalPawn;
- if (ClientPawn is Player)
+ var clientPawn = Game.LocalPawn;
+ if (clientPawn is Player {Camera: not null } player)
{
- return TeamOperations.GetTeamName(((Player)ClientPawn).CurrentTeam);
+ return TeamOperations.GetTeamName(player.Camera.GetObservedTeam());
}
return "";
}