Don't finish state if move mode changes but no move mode is required
This commit is contained in:
parent
c654bfd8fb
commit
09c817ef49
Binary file not shown.
@ -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;
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user