diff --git a/Source/vampires/VampirePlayerController.cpp b/Source/vampires/VampirePlayerController.cpp index ff004a8..210bd0a 100644 --- a/Source/vampires/VampirePlayerController.cpp +++ b/Source/vampires/VampirePlayerController.cpp @@ -42,6 +42,13 @@ void AVampirePlayerController::OnPossess(APawn* aPawn) } } +void AVampirePlayerController::OnUnPossess() +{ + Super::OnUnPossess(); + + GetWorld()->GetTimerManager().ClearTimer(pawnLifeTimeHandle); +} + void AVampirePlayerController::UpdatePlayerEXPHUD(int exp, float currentLevelPercent) { if (currentPlayerHUD) diff --git a/Source/vampires/VampirePlayerController.h b/Source/vampires/VampirePlayerController.h index 17a1385..a0fcc41 100644 --- a/Source/vampires/VampirePlayerController.h +++ b/Source/vampires/VampirePlayerController.h @@ -29,6 +29,8 @@ private: protected: virtual void OnPossess(APawn* aPawn) override; + virtual void OnUnPossess() override; + UFUNCTION() void UpdatePlayerEXPHUD(int exp, float currentLevelPercent);