minor player controller fixes

This commit is contained in:
Mamadou Babaei
2026-02-24 13:16:34 +01:00
parent 0c8b59ff14
commit 15ee7fac6a
@@ -98,7 +98,7 @@ float ASGPlayerController::FImpl::GetForceFeedbackLevel(const AActor* Actor)
{
if (IsValid(Actor))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
const USGTouchComponent* TouchComponent{USGTouchComponent::GetTouchComponent(Actor)};
if (IsValid(TouchComponent))
{
return TouchComponent->GetForceFeedbackLevel();
@@ -142,7 +142,7 @@ void ASGPlayerController::BeginPlay()
{
Super::BeginPlay();
ASGPawn* SGPawn = Cast<ASGPawn>(GetPawn());
ASGPawn* SGPawn{Cast<ASGPawn>(GetPawn())};
if (!ensureAlwaysMsgf(IsValid(SGPawn), TEXT("%s"), TEXT("ERROR: invalid SenseGlove pawn!")))
{
return;
@@ -233,7 +233,7 @@ USGCustomWaveform* ASGPlayerController::FImpl::GetCustomWaveform(const AActor* A
if (IsValid(Actor))
{
const USGTouchComponent* TouchComponent = USGTouchComponent::GetTouchComponent(Actor);
const USGTouchComponent* TouchComponent{USGTouchComponent::GetTouchComponent(Actor)};
if (IsValid(TouchComponent))
{
Amplitude = TouchComponent->GetVibrotactileAmplitude();
@@ -257,7 +257,7 @@ void ASGPlayerController::FImpl::UpdateHapticsFeedback(const FSGTouchState& Touc
return;
}
USGHapticGlove* Glove = TouchState.Hand->GetConnectedGlove();
USGHapticGlove* Glove{TouchState.Hand->GetConnectedGlove()};
if (!IsValid(Glove))
{
return;