Skip to content
Snippets Groups Projects
Commit 7baa5054 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

Hotfix: Adds workaround for IntenSelect crashing multiplayer.

parent d7049485
Branches
Tags
2 merge requests!90Draft: Forward propagate dev/5.3 changes into 5.4,!85UE5.3-2023.1-rc3
Pipeline #395009 failed
......@@ -85,31 +85,21 @@ void UIntenSelectComponent::BeginPlay()
void UIntenSelectComponent::InitInputBindings()
{
const APlayerController* PC = UGameplayStatics::GetPlayerController(GetWorld(), 0);
UEnhancedInputLocalPlayerSubsystem* Subsystem =
ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PC->GetLocalPlayer());
UInputComponent* PlayerInputComponent = PC->InputComponent;
UEnhancedInputComponent* PEI = Cast<UEnhancedInputComponent>(PlayerInputComponent);
const APawn* Pawn = Cast<APawn>(GetOwner());
if (!Pawn)
return;
UEnhancedInputComponent* EI = Cast<UEnhancedInputComponent>(Pawn->InputComponent);
if (!PEI)
if (!EI)
{
const FString Message = "Could not get PlayerInputComponent for IntenSelect Input Assignment!";
#if WITH_EDITOR
const FText Title = FText::FromString(FString("ERROR"));
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(Message), Title);
#endif
UE_LOG(LogTemp, Error, TEXT("%s"), *Message)
UKismetSystemLibrary::QuitGame(this, nullptr, EQuitPreference::Quit, false);
return;
}
// Bind the actions
PEI->BindAction(InputClick, ETriggerEvent::Started, this, &UIntenSelectComponent::OnFireDown);
PEI->BindAction(InputClick, ETriggerEvent::Completed, this, &UIntenSelectComponent::OnFireUp);
EI->BindAction(InputClick, ETriggerEvent::Started, this, &UIntenSelectComponent::OnFireDown);
EI->BindAction(InputClick, ETriggerEvent::Completed, this, &UIntenSelectComponent::OnFireUp);
}
void UIntenSelectComponent::InitSplineComponent()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment