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
 | 
			
		||||
 | 
			
		||||
	// IFFStateOwnerInterface
 | 
			
		||||
	UFUNCTION()
 | 
			
		||||
	virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) override;
 | 
			
		||||
 | 
			
		||||
	UFUNCTION()
 | 
			
		||||
    virtual bool CheckInputSequences(const TArray<FFFInputSequence>& InputSequences) override;
 | 
			
		||||
 | 
			
		||||
	virtual void DisableMostRecentInput() override;
 | 
			
		||||
 | 
			
		||||
@ -142,7 +142,12 @@ void UFFState::MovementModeChanged(EMovementMode PrevMovementMode, uint8 Previou
 | 
			
		||||
    OnMovementModeChanged(PrevMovementMode, PreviousCustomMode, 
 | 
			
		||||
        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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
 | 
			
		||||
#include "IFFStateOwnerInterface.generated.h"
 | 
			
		||||
 | 
			
		||||
UINTERFACE(MinimalAPI)
 | 
			
		||||
UINTERFACE(MinimalAPI, NotBlueprintable)
 | 
			
		||||
class UFFStateOwnerInterface : public UInterface
 | 
			
		||||
{
 | 
			
		||||
	GENERATED_BODY()
 | 
			
		||||
@ -21,8 +21,10 @@ class UNREALFIGHTINGFRAMEWORK_API IFFStateOwnerInterface
 | 
			
		||||
	GENERATED_BODY()
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface")
 | 
			
		||||
    virtual bool CheckInputSequence(const FFFInputSequence& InInputSequence) = 0;
 | 
			
		||||
 | 
			
		||||
    UFUNCTION(BlueprintCallable, Category="UFF State Owner Interface")
 | 
			
		||||
    virtual bool CheckInputSequences(const TArray<FFFInputSequence>& InInputSequences) = 0;
 | 
			
		||||
 | 
			
		||||
    virtual void DisableMostRecentInput() = 0;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user