Remove flying context

This commit is contained in:
2026-09-17 23:30:02 +02:00
parent 0af47d7bc3
commit d217397a80
4 changed files with 2 additions and 21 deletions

Binary file not shown.

View File

@@ -536,20 +536,6 @@ void AEleriPlayerController::OnStartFlyingAction(const FInputActionValue &Value)
MovementComponent->SetMovementMode(EMovementMode::MOVE_Walking);
}
if (UEnhancedInputLocalPlayerSubsystem *Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer()))
{
// PawnClientRestart can run more than once in an Actor's lifetime, so start by clearing out any leftover mappings.
if (bFlying)
{
Subsystem->RemoveMappingContext(MovementContext);
Subsystem->AddMappingContext(FlyingContext, 1);
}
else
{
Subsystem->RemoveMappingContext(FlyingContext);
Subsystem->AddMappingContext(MovementContext, 1);
}
}
if (PlayerCharacter)
{
PlayerCharacter->ToggleBroomActor(bFlying);

View File

@@ -184,8 +184,6 @@ public:
UPROPERTY(EditDefaultsOnly, Category = "Locomotion Input")
UInputAction* StartFlyingAction;
UPROPERTY(EditDefaultsOnly, Category = "Locomotion Input")
UInputMappingContext* FlyingContext;
UPROPERTY(EditDefaultsOnly, Category = "UI Input")
UInputMappingContext* UiContext;