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
No related branches found
No related tags found
2 merge requests!90Draft: Forward propagate dev/5.3 changes into 5.4,!85UE5.3-2023.1-rc3
Pipeline #395009 failed
This commit is part of merge request !85. Comments created here will be created in the context of that merge request.
...@@ -85,31 +85,21 @@ void UIntenSelectComponent::BeginPlay() ...@@ -85,31 +85,21 @@ void UIntenSelectComponent::BeginPlay()
void UIntenSelectComponent::InitInputBindings() void UIntenSelectComponent::InitInputBindings()
{ {
const APlayerController* PC = UGameplayStatics::GetPlayerController(GetWorld(), 0); const APawn* Pawn = Cast<APawn>(GetOwner());
if (!Pawn)
UEnhancedInputLocalPlayerSubsystem* Subsystem = return;
ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PC->GetLocalPlayer()); UEnhancedInputComponent* EI = Cast<UEnhancedInputComponent>(Pawn->InputComponent);
UInputComponent* PlayerInputComponent = PC->InputComponent;
UEnhancedInputComponent* PEI = Cast<UEnhancedInputComponent>(PlayerInputComponent);
if (!PEI) if (!EI)
{ {
const FString Message = "Could not get PlayerInputComponent for IntenSelect Input Assignment!"; 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) UE_LOG(LogTemp, Error, TEXT("%s"), *Message)
UKismetSystemLibrary::QuitGame(this, nullptr, EQuitPreference::Quit, false);
return; return;
} }
// Bind the actions // Bind the actions
PEI->BindAction(InputClick, ETriggerEvent::Started, this, &UIntenSelectComponent::OnFireDown); EI->BindAction(InputClick, ETriggerEvent::Started, this, &UIntenSelectComponent::OnFireDown);
PEI->BindAction(InputClick, ETriggerEvent::Completed, this, &UIntenSelectComponent::OnFireUp); EI->BindAction(InputClick, ETriggerEvent::Completed, this, &UIntenSelectComponent::OnFireUp);
} }
void UIntenSelectComponent::InitSplineComponent() void UIntenSelectComponent::InitSplineComponent()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment