From 4ae38adb208c435ff6a021cdd0517768c5314fe6 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 30 Jul 2023 19:12:09 +0100 Subject: Add observed health and team colours to spectator mode --- code/ui/health/Health.razor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'code/ui/health') 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; } -- cgit v1.2.3-70-g09d2