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) void AVampirePlayerController::UpdatePlayerEXPHUD(int exp, float currentLevelPercent)
{ {
if (currentPlayerHUD) if (currentPlayerHUD)

View File

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