Skip to content

Commit

Permalink
Tidying up warnings and deprecations for 5.2 upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
midgen committed May 27, 2023
1 parent 002db5d commit 9f1ec6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Source/UESVON/Private/AITask_SVONMoveTo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void UAITask_SVONMoveTo::OnRequestFinished(FAIRequestID RequestID, const FPathFo

void UAITask_SVONMoveTo::OnPathEvent(FNavigationPath* InPath, ENavPathEvent::Type Event)
{
const static UEnum* NavPathEventEnum = FindObject<UEnum>(ANY_PACKAGE, TEXT("ENavPathEvent"));
const static UEnum* NavPathEventEnum = FindObject<UEnum>(this, TEXT("ENavPathEvent"));
UE_VLOG(GetGameplayTasksComponent(), LogGameplayTasks, Log, TEXT("%s> Path event: %s"), *GetName(), *NavPathEventEnum->GetNameStringByValue(Event));

switch (Event)
Expand Down
18 changes: 5 additions & 13 deletions Source/UESVON/Private/BTTask_SVONMoveTo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ UBTTask_SVONMoveTo::UBTTask_SVONMoveTo(const FObjectInitializer& ObjectInitializ
: Super(ObjectInitializer)
{
NodeName = "SVON Move To";
bNotifyTick = ~bUseGameplayTasks;
bNotifyTick = false;
bNotifyTaskFinished = true;

AcceptableRadius = GET_AI_CONFIG_VAR(AcceptanceRadius);
Expand All @@ -39,7 +39,7 @@ EBTNodeResult::Type UBTTask_SVONMoveTo::ExecuteTask(UBehaviorTreeComponent& Owne
MyMemory->MoveRequestID = FAIRequestID::InvalidRequest;

AAIController* MyController = OwnerComp.GetAIOwner();
MyMemory->bWaitingForPath = bUseGameplayTasks ? false : MyController->ShouldPostponePathUpdates();
MyMemory->bWaitingForPath = false;
if (!MyMemory->bWaitingForPath)
{
NodeResult = PerformMoveTask(OwnerComp, NodeMemory);
Expand Down Expand Up @@ -222,18 +222,10 @@ EBlackboardNotificationResult UBTTask_SVONMoveTo::OnBlackboardValueChange(const
BehaviorComp->GetAIOwner()->GetPathFollowingComponent()->AbortMove(*this, FPathFollowingResultFlags::NewRequest, MyMemory->MoveRequestID, EPathFollowingVelocityMode::Keep);
}

if (!bUseGameplayTasks && BehaviorComp->GetAIOwner()->ShouldPostponePathUpdates())
{
// NodeTick will take care of requesting move
MyMemory->bWaitingForPath = true;
}
else
const EBTNodeResult::Type NodeResult = PerformMoveTask(*BehaviorComp, RawMemory);
if (NodeResult != EBTNodeResult::InProgress)
{
const EBTNodeResult::Type NodeResult = PerformMoveTask(*BehaviorComp, RawMemory);
if (NodeResult != EBTNodeResult::InProgress)
{
FinishLatentTask(*BehaviorComp, NodeResult);
}
FinishLatentTask(*BehaviorComp, NodeResult);
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions Source/UESVON/Public/BTTask_SVONMoveTo.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ class UESVON_API UBTTask_SVONMoveTo : public UBTTask_BlackboardBase
UPROPERTY(Category = Node, EditAnywhere)
bool bUseAsyncPathfinding;

/** set automatically if move should use GameplayTasks */
uint32 bUseGameplayTasks : 1;

virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override;
virtual EBTNodeResult::Type AbortTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override;
virtual void OnTaskFinished(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTNodeResult::Type TaskResult) override;
Expand Down

0 comments on commit 9f1ec6b

Please sign in to comment.