From e694e647b0a6812baf96104df84778279f15d286 Mon Sep 17 00:00:00 2001 From: baz Date: Sun, 17 Nov 2024 21:47:10 +0000 Subject: [PATCH] VampirePlayerController cleanup --- Source/vampires/VampirePlayerController.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/vampires/VampirePlayerController.cpp b/Source/vampires/VampirePlayerController.cpp index 210bd0a..82c34ba 100644 --- a/Source/vampires/VampirePlayerController.cpp +++ b/Source/vampires/VampirePlayerController.cpp @@ -4,7 +4,6 @@ #include "VampirePlayerController.h" #include "EXPComponent.h" -#include "HealthComponent.h" #include "VampireGameMode.h" #include "Blueprint/UserWidget.h" #include "Kismet/GameplayStatics.h" @@ -25,9 +24,8 @@ void AVampirePlayerController::OnPossess(APawn* aPawn) UpdatePlayerEXPHUD(expComponent->GetCurrentEXP(), expComponent->GetCurrentLevelPercent()); UpdatePlayerLevelHUD(expComponent->GetCurrentLevel()); } - - AVampireGameMode* gamemode = Cast(UGameplayStatics::GetGameMode(GetWorld())); - if (gamemode) + + if (AVampireGameMode* gamemode = Cast(UGameplayStatics::GetGameMode(GetWorld()))) { gamemode->OnEnemyDeathCountIncrementDelegate.AddDynamic(this, &AVampirePlayerController::UpdateKillCountHUD); UpdateKillCountHUD(gamemode->GetEnemyDeathCount());