Fixed various crashes and infinite loops when encountering unhandled or null combo input assets.
This commit is contained in:
parent
a4913db597
commit
aa81438bc7
@ -77,12 +77,10 @@ void UComboManagerComponent::ActivateComboAction(const UComboInputAsset *Input)
|
||||
this->BroadcastDelegates(*ComboAction, EComboActionTriggerEvent::Activated);
|
||||
UE_LOG(LogComboManagerComponent, Verbose, TEXT("Fallback action %s activated"), *(*ComboAction)->ActionName.ToString());
|
||||
}
|
||||
// If we haven't found an action to perform, reset the combo and activate using the default start node.
|
||||
// If we haven't found an action to perform, end here.
|
||||
else
|
||||
{
|
||||
this->ActiveNode = nullptr;
|
||||
this->ActivateComboAction(Input);
|
||||
return;
|
||||
UE_LOG(LogComboManagerComponent, Verbose, TEXT("No action found for %s"), *Input->ComboInputName.ToString());
|
||||
}
|
||||
}
|
||||
void UComboManagerComponent::DEBUG__UnlockAction(TObjectPtr<const UComboInputAsset> Unlock)
|
||||
|
||||
@ -28,9 +28,16 @@ void UInputBufferComponent::BeginPlay()
|
||||
TSet<const UInputAction *> InputActionsToBind;
|
||||
for (TSoftObjectPtr<const UComboInputAsset> ComboInput : Settings->ComboActions)
|
||||
{
|
||||
for (const UInputAction *InputAction : ComboInput->ActionGroup)
|
||||
if (ComboInput.IsValid())
|
||||
{
|
||||
InputActionsToBind.Add(InputAction);
|
||||
for (const UInputAction *InputAction : ComboInput->ActionGroup)
|
||||
{
|
||||
InputActionsToBind.Add(InputAction);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogInputBufferComponent, Verbose, TEXT("Invalid combo action found in Combo Actions list in %s"), *Settings->GetClass()->GetName());
|
||||
}
|
||||
}
|
||||
for (const UInputAction *InputAction : InputActionsToBind)
|
||||
@ -52,11 +59,18 @@ void UInputBufferComponent::AddActionToBuffer(const FInputActionValue &Value, co
|
||||
const UInputBufferSubsystemGlobalSettings *Settings = GetDefault<UInputBufferSubsystemGlobalSettings>();
|
||||
for (TSoftObjectPtr<const UComboInputAsset> ComboInput : Settings->ComboActions)
|
||||
{
|
||||
if (ComboInput->MatchesInputActions(this->MostRecentActions))
|
||||
if (ComboInput.IsValid())
|
||||
{
|
||||
this->ActivateComboInput(ComboInput.Get());
|
||||
if (ComboInput->MatchesInputActions(this->MostRecentActions))
|
||||
{
|
||||
this->ActivateComboInput(ComboInput.Get());
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UE_LOG(LogInputBufferComponent, Verbose, TEXT("Invalid combo action found in Combo Actions list in %s"), *Settings->GetClass()->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user