Skip to content

Commit

Permalink
BTT_PlayAnimMontage - fix aborting (#6)
Browse files Browse the repository at this point in the history
* - fix Compilation error

* - fix bIsAborting state will not reset, and if it is true, it will never become false
- remove redundant member variables
  • Loading branch information
nozomanai authored Aug 25, 2024
1 parent 0a33f5e commit f2d1ba2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ EBTNodeResult::Type UBTT_PlayAnimMontage::ExecuteTask(UBehaviorTreeComponent& Ow
{
EBTNodeResult::Type Result = EBTNodeResult::Failed;

bIsAborting = false;
FUHLPlayAnimMontageMemory* MyMemory = CastInstanceNodeMemory<FUHLPlayAnimMontageMemory>(NodeMemory);

AIOwner = OwnerComp.GetAIOwner();
AAIController* AIOwner = OwnerComp.GetAIOwner();
OwnerComponent = &OwnerComp;
if (!AIOwner.Get())
if (!AIOwner)
{
Result = EBTNodeResult::Failed;
return Result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include "CoreMinimal.h"
#include "Misc/EngineVersionComparison.h"
#include "BehaviorTree/Services/BTService_DefaultFocus.h"
#include "BTS_GameplayFocus.generated.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ class UNREALHELPERLIBRARY_API UBTT_PlayAnimMontage : public UBTTaskNode
private:
bool bIsAborting = false;
TWeakObjectPtr<ACharacter> Character;
/** Cached AIController owner of BehaviorTreeComponent. */
UPROPERTY(Transient)
TObjectPtr<AAIController> AIOwner;

UPROPERTY()
TObjectPtr<UBehaviorTreeComponent> OwnerComponent;

Expand Down

0 comments on commit f2d1ba2

Please sign in to comment.