Skip to content

Commit 2e6eeff

Browse files
committed
Sequence node: bSavePinExecutionState is now True by default
This addressed a common issue with handling SaveGame for a directed graph.
1 parent 3846bbd commit 2e6eeff

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
UFlowNode_ExecutionSequence::UFlowNode_ExecutionSequence(const FObjectInitializer& ObjectInitializer)
66
: Super(ObjectInitializer)
7+
, bSavePinExecutionState(true)
78
{
89
#if WITH_EDITOR
910
Category = TEXT("Route");
@@ -16,12 +17,12 @@ UFlowNode_ExecutionSequence::UFlowNode_ExecutionSequence(const FObjectInitialize
1617

1718
void UFlowNode_ExecutionSequence::ExecuteInput(const FName& PinName)
1819
{
19-
if(bSavePinExecutionState)
20+
if (bSavePinExecutionState)
2021
{
2122
ExecuteNewConnections();
2223
return;
2324
}
24-
25+
2526
for (const FFlowPin& Output : OutputPins)
2627
{
2728
TriggerOutput(Output.PinName, false);
@@ -33,11 +34,11 @@ void UFlowNode_ExecutionSequence::ExecuteInput(const FName& PinName)
3334
#if WITH_EDITOR
3435
FString UFlowNode_ExecutionSequence::GetNodeDescription() const
3536
{
36-
if(bSavePinExecutionState)
37+
if (bSavePinExecutionState)
3738
{
3839
return TEXT("Saves pin execution state");
3940
}
40-
41+
4142
return Super::GetNodeDescription();
4243
}
4344
#endif
@@ -52,12 +53,12 @@ void UFlowNode_ExecutionSequence::ExecuteNewConnections()
5253
for (const FFlowPin& Output : OutputPins)
5354
{
5455
const FConnectedPin& Connection = GetConnection(Output.PinName);
55-
if(ExecutedConnections.Contains(Connection.NodeGuid))
56+
if (!ExecutedConnections.Contains(Connection.NodeGuid))
5657
{
57-
continue;
58+
ExecutedConnections.Emplace(Connection.NodeGuid);
59+
TriggerOutput(Output.PinName, false);
5860
}
59-
60-
TriggerOutput(Output.PinName, false);
61-
ExecutedConnections.Emplace(Connection.NodeGuid);
6261
}
62+
63+
Finish();
6364
}

Source/Flow/Public/Nodes/Route/FlowNode_ExecutionSequence.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class FLOW_API UFlowNode_ExecutionSequence final : public UFlowNode
3737
* graph after release.
3838
*/
3939
UPROPERTY(EditAnywhere, Category = "Sequence")
40-
bool bSavePinExecutionState = false;
40+
bool bSavePinExecutionState;
4141

4242
UPROPERTY(SaveGame)
4343
TSet<FGuid> ExecutedConnections;

0 commit comments

Comments
 (0)