Fix name lookup in WingActorComponent

This commit is contained in:
2026-03-19 22:52:39 -04:00
parent fae73e821d
commit 77a3c552f8

View File

@@ -32,8 +32,16 @@ FString FWingActorComponent::GetParentName() const
{ {
if (SCSNode) if (SCSNode)
{ {
// Cross-blueprint case: parent is inherited, stored by name.
if (SCSNode->ParentComponentOrVariableName != NAME_None) if (SCSNode->ParentComponentOrVariableName != NAME_None)
return WingUtils::SanitizeName(SCSNode->ParentComponentOrVariableName); return WingUtils::SanitizeName(SCSNode->ParentComponentOrVariableName);
// Same-blueprint case: find the node whose child list contains us.
for (USCS_Node* Candidate : SCSNode->GetSCS()->GetAllNodes())
{
if (Candidate->ChildNodes.Contains(SCSNode))
return WingUtils::FormatName(Candidate);
}
return FString(); return FString();
} }
if (NativeComponent) if (NativeComponent)