Fix name lookup in WingActorComponent
This commit is contained in:
@@ -32,8 +32,16 @@ FString FWingActorComponent::GetParentName() const
|
||||
{
|
||||
if (SCSNode)
|
||||
{
|
||||
// Cross-blueprint case: parent is inherited, stored by name.
|
||||
if (SCSNode->ParentComponentOrVariableName != NAME_None)
|
||||
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();
|
||||
}
|
||||
if (NativeComponent)
|
||||
|
||||
Reference in New Issue
Block a user