diff --git a/Source/Flow/Private/FlowAsset.cpp b/Source/Flow/Private/FlowAsset.cpp index c594e476..23416fb0 100644 --- a/Source/Flow/Private/FlowAsset.cpp +++ b/Source/Flow/Private/FlowAsset.cpp @@ -1169,7 +1169,7 @@ FFlowAssetSaveData UFlowAsset::SaveInstance(TArray& SavedFlo GetNodesInExecutionOrder(GetDefaultEntryNode(), NodesInExecutionOrder); for (UFlowNode* Node : NodesInExecutionOrder) { - if (Node && Node->ActivationState == EFlowNodeState::Active) + if (Node && Node->ShouldSave()) { // iterate SubGraphs if (UFlowNode_SubGraph* SubGraphNode = Cast(Node)) diff --git a/Source/Flow/Private/Nodes/FlowNode.cpp b/Source/Flow/Private/Nodes/FlowNode.cpp index be876bee..6bf93c19 100644 --- a/Source/Flow/Private/Nodes/FlowNode.cpp +++ b/Source/Flow/Private/Nodes/FlowNode.cpp @@ -1067,6 +1067,11 @@ void UFlowNode::OnPassThrough_Implementation() Finish(); } +bool UFlowNode::ShouldSave_Implementation() +{ + return GetActivationState() == EFlowNodeState::Active; +} + #if WITH_EDITOR TMap UFlowNode::GetWireRecords() const { diff --git a/Source/Flow/Public/Nodes/FlowNode.h b/Source/Flow/Public/Nodes/FlowNode.h index 9e2aec14..dbfcff17 100644 --- a/Source/Flow/Public/Nodes/FlowNode.h +++ b/Source/Flow/Public/Nodes/FlowNode.h @@ -357,6 +357,9 @@ class FLOW_API UFlowNode UFUNCTION(BlueprintNativeEvent, Category = "FlowNode") void OnPassThrough(); + + UFUNCTION(BlueprintNativeEvent, Category = "FlowNode") + bool ShouldSave(); ////////////////////////////////////////////////////////////////////////// // Utils