Don't finish state if move mode changes but no move mode is required

This commit is contained in:
Kevin Poretti 2023-10-20 15:34:41 -04:00
parent c654bfd8fb
commit 09c817ef49
4 changed files with 11 additions and 2 deletions

Binary file not shown.

View File

@ -52,8 +52,10 @@ public:
// End of IFFSystemInterface // End of IFFSystemInterface
// IFFStateOwnerInterface // IFFStateOwnerInterface
UFUNCTION()
virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) override; virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) override;
UFUNCTION()
virtual bool CheckInputSequences(const TArray<FFFInputSequence>& InputSequences) override; virtual bool CheckInputSequences(const TArray<FFFInputSequence>& InputSequences) override;
virtual void DisableMostRecentInput() override; virtual void DisableMostRecentInput() override;

View File

@ -142,7 +142,12 @@ void UFFState::MovementModeChanged(EMovementMode PrevMovementMode, uint8 Previou
OnMovementModeChanged(PrevMovementMode, PreviousCustomMode, OnMovementModeChanged(PrevMovementMode, PreviousCustomMode,
NewMovementMode, NewCustomMode, InStateContext); NewMovementMode, NewCustomMode, InStateContext);
if(NewMovementMode != ReqMovementMode || ((ReqMovementMode == MOVE_Custom) && NewCustomMode != RequiredCustomMode)) // TODO: Movement mode MOVE_None means movement is disabled but in this context it means no movement
// mode is specifically required to stay in this state i.e. changing from falling to walking
// will not exit out of this state. I think I want to use my own movement mode enum just so I
// can explicitly document this is what is meant by none
if((ReqMovementMode != EMovementMode::MOVE_None && NewMovementMode != ReqMovementMode) ||
((ReqMovementMode == MOVE_Custom) && NewCustomMode != RequiredCustomMode))
{ {
Finish(InStateContext); Finish(InStateContext);
} }

View File

@ -7,7 +7,7 @@
#include "IFFStateOwnerInterface.generated.h" #include "IFFStateOwnerInterface.generated.h"
UINTERFACE(MinimalAPI) UINTERFACE(MinimalAPI, NotBlueprintable)
class UFFStateOwnerInterface : public UInterface class UFFStateOwnerInterface : public UInterface
{ {
GENERATED_BODY() GENERATED_BODY()
@ -21,8 +21,10 @@ class UNREALFIGHTINGFRAMEWORK_API IFFStateOwnerInterface
GENERATED_BODY() GENERATED_BODY()
public: public:
UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface")
virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) = 0; virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) = 0;
UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface")
virtual bool CheckInputSequences(const TArray<FFFInputSequence>& InInputSequences) = 0; virtual bool CheckInputSequences(const TArray<FFFInputSequence>& InInputSequences) = 0;
virtual void DisableMostRecentInput() = 0; virtual void DisableMostRecentInput() = 0;