diff --git a/Source/UnrealFightingFramework/Input/FFPlayerController.cpp b/Source/UnrealFightingFramework/Input/FFPlayerController.cpp index 0401d1f..7fe45cd 100644 --- a/Source/UnrealFightingFramework/Input/FFPlayerController.cpp +++ b/Source/UnrealFightingFramework/Input/FFPlayerController.cpp @@ -35,6 +35,12 @@ void AFFPlayerController::FixedTick(float OneFrame) bool AFFPlayerController::CheckInputSequences(const TArray& InputSequences) { + // no input conditions to check + if(InputSequences.IsEmpty()) + { + return true; + } + for(const FFFInputSequence& ThisInputSequence : InputSequences) { if(InputBuffer->CheckInputSequence(ThisInputSequence)) diff --git a/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp b/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp index 4af0eb3..286b4dd 100644 --- a/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp +++ b/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp @@ -167,7 +167,8 @@ void UFFStateMachineComponent::FixedTick(float OneFrame) for(UFFState* ThisState : States) { // found a state - if(ThisState->CanTransition(GetCurrentStateContext())) + if(ThisState->CanTransition(GetCurrentStateContext()) && + (CurrentState->Name != ThisState->Name || ThisState->bCanTransitionToSelf)) { StateToTransitionTo = ThisState; break; @@ -176,8 +177,7 @@ void UFFStateMachineComponent::FixedTick(float OneFrame) // Lastly just check if the state we're about to transition into isn't the current state. // It is OK to transition if state's "CanTransitionToSelf" is true - if(StateToTransitionTo && - (CurrentState->Name != StateToTransitionTo->Name || StateToTransitionTo->bCanTransitionToSelf)) + if(StateToTransitionTo) { GoToState(StateToTransitionTo); } @@ -213,7 +213,7 @@ void UFFStateMachineComponent::TickComponent(float DeltaTime, ELevelTick TickTyp Super::TickComponent(DeltaTime, TickType, ThisTickFunction); // Debug - if(StateMachineDebug) + if(StateMachineDebug && CurrentState) { FString SMDebugString = "---State Machine Info---\n"; SMDebugString.Append(FString::Printf(TEXT("Current State: %s\n"), *CurrentState->Name.ToString()));