Clear timer in OnUnPossess

This commit is contained in:
baz 2024-11-17 21:45:29 +00:00
parent a13cad7320
commit 929c4fa0f3
2 changed files with 9 additions and 0 deletions

View File

@ -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)

View File

@ -29,6 +29,8 @@ private:
protected:
virtual void OnPossess(APawn* aPawn) override;
virtual void OnUnPossess() override;
UFUNCTION()
void UpdatePlayerEXPHUD(int exp, float currentLevelPercent);