Skip to content

Commit a014f47

Browse files
committed
Merge branch 'main' into feature/CI
2 parents 8002ad5 + d12fa13 commit a014f47

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

Source/UnrealHelperLibrary/Private/AI/Composite/BTC_RandomSelector.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
#include "BehaviorTree/BTTaskNode.h"
77
#include "BehaviorTree/BTCompositeNode.h"
88
#include "BehaviorTree/BehaviorTreeComponent.h"
9+
#include "BehaviorTree/BlackboardComponent.h"
910
#include "Misc/EngineVersionComparison.h"
11+
#include "GameFramework/Actor.h"
12+
#include "VisualLogger/VisualLogger.h"
13+
#include "BehaviorTree/BTTaskNode.h"
14+
#include "BehaviorTree/BTAuxiliaryNode.h"
1015
#include "Kismet/KismetMathLibrary.h"
1116

1217
#include UE_INLINE_GENERATED_CPP_BY_NAME(BTC_RandomSelector)
@@ -87,21 +92,16 @@ FName UBTC_RandomSelector::GetNodeIconName() const
8792
#endif
8893

8994
#if UE_VERSION_NEWER_THAN(5, 4, 0)
90-
uint16 UBTC_RandomSelector::GetInstanceMemorySize() const
91-
{
92-
return sizeof(FBTRandomSelectorMemory);
93-
}
94-
9595
void UBTC_RandomSelector::InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory,
9696
EBTMemoryInit::Type InitType) const
9797
{
98-
InitializeNodeMemory<FBTRandomSelectorMemory>(NodeMemory, InitType);
98+
InitializeNodeMemory<FBTCompositeMemory>(NodeMemory, InitType);
9999
}
100100

101101
void UBTC_RandomSelector::CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory,
102102
EBTMemoryClear::Type CleanupType) const
103103
{
104-
CleanupNodeMemory<FBTRandomSelectorMemory>(NodeMemory, CleanupType);
104+
CleanupNodeMemory<FBTCompositeMemory>(NodeMemory, CleanupType);
105105
}
106106
#endif
107107

Source/UnrealHelperLibrary/Private/AI/Services/BTS_GameplayFocus.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "BehaviorTree/BlackboardComponent.h"
88
#include "BehaviorTree/BehaviorTreeComponent.h"
99
#include "BehaviorTree/BehaviorTreeTypes.h"
10+
#include "BehaviorTree/Services/BTService_DefaultFocus.h"
1011
#include "AIController.h"
1112

1213
#include UE_INLINE_GENERATED_CPP_BY_NAME(BTS_GameplayFocus)

Source/UnrealHelperLibrary/Public/AI/Composite/BTC_RandomSelector.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
#pragma once
44

55
#include "CoreMinimal.h"
6+
#include "UObject/ObjectMacros.h"
67
#include "BehaviorTree/BTCompositeNode.h"
78
#include "BehaviorTree/BehaviorTreeTypes.h"
89
#include "Misc/EngineVersionComparison.h"
910
#include "BTC_RandomSelector.generated.h"
1011

1112
class UBehaviorTreeComponent;
1213

13-
struct FBTRandomSelectorMemory
14-
{
15-
};
14+
// Should nest from "FBTCompositeMemory" or build error fail on FAB servers
15+
// struct FBTRandomSelectorMemory : public FBTCompositeMemory
16+
// {
17+
// };
1618

1719
/**
1820
* RandomSelector composite node.
@@ -28,7 +30,7 @@ class UNREALHELPERLIBRARY_API UBTC_RandomSelector : public UBTCompositeNode
2830
GENERATED_BODY()
2931

3032
public:
31-
explicit UBTC_RandomSelector(const FObjectInitializer& ObjectInitializer);
33+
UBTC_RandomSelector(const FObjectInitializer& ObjectInitializer);
3234

3335
// TODO validate that chances count == ChildrenNum
3436
// if no chance specified, node without chance will win always
@@ -48,7 +50,6 @@ class UNREALHELPERLIBRARY_API UBTC_RandomSelector : public UBTCompositeNode
4850

4951
#if UE_VERSION_NEWER_THAN(5, 4, 0)
5052
// 5.4.0 and up only code
51-
virtual uint16 GetInstanceMemorySize() const override;
5253
virtual void InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const override;
5354
virtual void CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const override;
5455
#endif

Source/UnrealHelperLibrary/Public/AI/Services/BTS_GameplayFocus.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class UNREALHELPERLIBRARY_API UBTS_GameplayFocus : public UBTService_DefaultFocu
2727
UBTS_GameplayFocus(const FObjectInitializer& ObjectInitializer);
2828

2929
#if UE_VERSION_NEWER_THAN(5, 4, 0)
30-
virtual uint16 GetInstanceMemorySize() const override { return sizeof(FBTFocusMemory); }
3130
virtual void InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const override;
3231
virtual void CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const override;
3332
#endif

0 commit comments

Comments
 (0)