diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2023-07-30 19:12:09 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2023-07-30 19:12:09 +0100 |
| commit | 4ae38adb208c435ff6a021cdd0517768c5314fe6 (patch) | |
| tree | 18ccbffd5fd3d385983ba41f3cd0031586995733 /code/ui/health/Health.razor | |
| parent | 970e3de202b1482ae72b85487414d9b933818774 (diff) | |
Add observed health and team colours to spectator mode
Diffstat (limited to 'code/ui/health/Health.razor')
| -rw-r--r-- | code/ui/health/Health.razor | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/code/ui/health/Health.razor b/code/ui/health/Health.razor index 8961f63..9600c8b 100644 --- a/code/ui/health/Health.razor +++ b/code/ui/health/Health.razor @@ -30,10 +30,10 @@ Health { public int GetHealth()
{
- var ClientPawn = Game.LocalPawn;
- if (ClientPawn is Player)
+ var clientPawn = Game.LocalPawn;
+ if (clientPawn is Player {Camera: not null } player)
{
- return ClientPawn.Health.CeilToInt();
+ return player.Camera.GetObservedHealth().CeilToInt();
}
return 0;
}
|
