Skip to content

Commit bdec5ff

Browse files
committed
Fix function overrides not replacing custom events
1 parent 9048339 commit bdec5ff

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

AssetGenerator/Source/AssetGenerator/Private/Toolkit/AssetTypeGenerator/BlueprintGenerator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,12 @@ bool FBlueprintGeneratorUtils::CreateNewBlueprintFunctions(UBlueprint* Blueprint
782782
if (OverridenFunction) {
783783
UK2Node_EditablePinBase* const* FunctionImplementation = FunctionAndEventNodes.Find(Function.FunctionName);
784784

785+
//We need to recreate the node if it was a custom event before, but now it is an override
786+
if (FunctionImplementation != NULL && (*FunctionImplementation)->IsA(UK2Node_CustomEvent::StaticClass())) {
787+
FBlueprintEditorUtils::RemoveNode(Blueprint, *FunctionImplementation, true);
788+
FunctionImplementation = NULL;
789+
}
790+
785791
//We want to create the override even if function exists, but it's actually a ghost node
786792
if ((FunctionImplementation == NULL || (*FunctionImplementation)->IsAutomaticallyPlacedGhostNode()) && bCreateFunctionOverrides) {
787793
const bool bShouldGenerateAsEvent = Function.bIsCallingIntoUbergraph && UEdGraphSchema_K2::FunctionCanBePlacedAsEvent(OverridenFunction);

0 commit comments

Comments
 (0)