Skip to content

Commit

Permalink
Sequence node: bSavePinExecutionState is now True by default
Browse files Browse the repository at this point in the history
This addressed a common issue with handling SaveGame for a directed graph.
  • Loading branch information
MothDoctor committed Sep 1, 2023
1 parent 98d8fdc commit 6d00a2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions Source/Flow/Private/Nodes/Route/FlowNode_ExecutionSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

UFlowNode_ExecutionSequence::UFlowNode_ExecutionSequence(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, bSavePinExecutionState(true)
{
#if WITH_EDITOR
Category = TEXT("Route");
Expand All @@ -16,12 +17,12 @@ UFlowNode_ExecutionSequence::UFlowNode_ExecutionSequence(const FObjectInitialize

void UFlowNode_ExecutionSequence::ExecuteInput(const FName& PinName)
{
if(bSavePinExecutionState)
if (bSavePinExecutionState)
{
ExecuteNewConnections();
return;
}

for (const FFlowPin& Output : OutputPins)
{
TriggerOutput(Output.PinName, false);
Expand All @@ -33,11 +34,11 @@ void UFlowNode_ExecutionSequence::ExecuteInput(const FName& PinName)
#if WITH_EDITOR
FString UFlowNode_ExecutionSequence::GetNodeDescription() const
{
if(bSavePinExecutionState)
if (bSavePinExecutionState)
{
return TEXT("Saves pin execution state");
}

return Super::GetNodeDescription();
}
#endif
Expand All @@ -52,12 +53,12 @@ void UFlowNode_ExecutionSequence::ExecuteNewConnections()
for (const FFlowPin& Output : OutputPins)
{
const FConnectedPin& Connection = GetConnection(Output.PinName);
if(ExecutedConnections.Contains(Connection.NodeGuid))
if (!ExecutedConnections.Contains(Connection.NodeGuid))
{
continue;
ExecutedConnections.Emplace(Connection.NodeGuid);
TriggerOutput(Output.PinName, false);
}

TriggerOutput(Output.PinName, false);
ExecutedConnections.Emplace(Connection.NodeGuid);
}

Finish();
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FLOW_API UFlowNode_ExecutionSequence final : public UFlowNode
* graph after release.
*/
UPROPERTY(EditAnywhere, Category = "Sequence")
bool bSavePinExecutionState = false;
bool bSavePinExecutionState;

UPROPERTY(SaveGame)
TSet<FGuid> ExecutedConnections;
Expand Down

0 comments on commit 6d00a2d

Please sign in to comment.