Actually initialize the input buffer on the AI controller
This commit is contained in:
parent
a074478f81
commit
5a967109fa
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
AFFAIController::AFFAIController()
|
AFFAIController::AFFAIController()
|
||||||
{
|
{
|
||||||
|
InputBuffer = CreateDefaultSubobject<UFFInputBufferComponent>(TEXT("InputBuffer"));
|
||||||
bWantsPlayerState = true;
|
bWantsPlayerState = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,5 +26,6 @@ FVector AFFAIController::GetInputAsWorldDirection() const
|
|||||||
|
|
||||||
void AFFAIController::DisableMostRecentInput()
|
void AFFAIController::DisableMostRecentInput()
|
||||||
{
|
{
|
||||||
|
check(InputBuffer);
|
||||||
InputBuffer->DisableMostRecentInput();
|
InputBuffer->DisableMostRecentInput();
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,11 @@ bool UFFInputBufferComponent::CheckInputSequence(const FFFInputSequence& InputSe
|
|||||||
|
|
||||||
void UFFInputBufferComponent::DisableMostRecentInput()
|
void UFFInputBufferComponent::DisableMostRecentInput()
|
||||||
{
|
{
|
||||||
|
if(InputBuffer.Num() < 2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
InputBuffer[InputBuffer.Num() - 1].DisabledButtons |= InputBuffer[InputBuffer.Num() - 1].Buttons;
|
InputBuffer[InputBuffer.Num() - 1].DisabledButtons |= InputBuffer[InputBuffer.Num() - 1].Buttons;
|
||||||
InputBuffer[InputBuffer.Num() - 2].DisabledButtons |= InputBuffer[InputBuffer.Num() - 2].Buttons;
|
InputBuffer[InputBuffer.Num() - 2].DisabledButtons |= InputBuffer[InputBuffer.Num() - 2].Buttons;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user