Fix two important bugs: the tokenizer was tokenizing '.' in identifiers wrong, and WingComponent was using the native flag incorrectly.

This commit is contained in:
2026-04-07 22:28:12 -04:00
parent f77a8553e1
commit e9af515c05
2 changed files with 11 additions and 11 deletions

View File

@@ -216,14 +216,14 @@ TMap<FName, FName> UWingComponentReference::CalculateParentNames(USimpleConstruc
UActorComponent* UWingComponentReference::GetImmutableTemplate() const UActorComponent* UWingComponentReference::GetImmutableTemplate() const
{ {
if (Native) return FindComponentInCDO(BP->GeneratedClass, VariableName); FoundComponent FC = FindComponent(BP, VariableName);
USCS_Node *Node = FindSCSNodeByName(BP, VariableName); if (FC.Native) return FC.Native;
if (Node == nullptr) return nullptr; if (FC.SCS == nullptr) return nullptr;
FComponentKey Key(Node); FComponentKey Key(FC.SCS);
for (UBlueprint *WalkBP : WingUtils::GetAncestorBlueprints(BP, false)) for (UBlueprint *WalkBP : WingUtils::GetAncestorBlueprints(BP, false))
{ {
if (Node->GetSCS()->GetBlueprint() == WalkBP) return Node->ComponentTemplate; if (FC.SCS->GetSCS()->GetBlueprint() == WalkBP) return FC.SCS->ComponentTemplate;
UInheritableComponentHandler* ICH = WalkBP->GetInheritableComponentHandler(/*bCreateIfNecessary=*/ false); UInheritableComponentHandler* ICH = WalkBP->GetInheritableComponentHandler(/*bCreateIfNecessary=*/ false);
if (!ICH) continue; if (!ICH) continue;
UActorComponent* Override = ICH->GetOverridenComponentTemplate(Key); UActorComponent* Override = ICH->GetOverridenComponentTemplate(Key);
@@ -234,12 +234,12 @@ UActorComponent* UWingComponentReference::GetImmutableTemplate() const
UActorComponent* UWingComponentReference::GetMutableTemplate() const UActorComponent* UWingComponentReference::GetMutableTemplate() const
{ {
if (Native) return FindComponentInCDO(BP->GeneratedClass, VariableName); FoundComponent FC = FindComponent(BP, VariableName);
USCS_Node* Node = FindSCSNodeByName(BP, VariableName); if (FC.Native) return FC.Native;
if (!Node) return nullptr; if (!FC.SCS) return nullptr;
if (Node->GetSCS()->GetBlueprint() == BP) return Node->ComponentTemplate; if (FC.SCS->GetSCS()->GetBlueprint() == BP) return FC.SCS->ComponentTemplate;
FComponentKey Key(Node); FComponentKey Key(FC.SCS);
UInheritableComponentHandler* ICH = BP->GetInheritableComponentHandler(/*bCreateIfNecessary=*/ true); UInheritableComponentHandler* ICH = BP->GetInheritableComponentHandler(/*bCreateIfNecessary=*/ true);
if (!ICH) return nullptr; if (!ICH) return nullptr;
UActorComponent* Override = ICH->GetOverridenComponentTemplate(Key); UActorComponent* Override = ICH->GetOverridenComponentTemplate(Key);

View File

@@ -148,7 +148,7 @@ FName WingTokenizer::TokenizeIdentifier(FStringView &Rest, FString &Error)
if (Ch == ' ') break; if (Ch == ' ') break;
if (Ch == '.') if (Ch == '.')
{ {
if (Len < NAME_SIZE) Buffer[Len++] = Ch; if (Len < NAME_SIZE) Buffer[Len++] = ' ';
Rest = Rest.RightChop(1); Rest = Rest.RightChop(1);
continue; continue;
} }