From e9af515c052660bba1cf6311c9a0e81f38787dde Mon Sep 17 00:00:00 2001 From: jyelon Date: Tue, 7 Apr 2026 22:28:12 -0400 Subject: [PATCH] Fix two important bugs: the tokenizer was tokenizing '.' in identifiers wrong, and WingComponent was using the native flag incorrectly. --- .../UEWingman/Private/WingActorComponent.cpp | 20 +++++++++---------- .../UEWingman/Private/WingTokenizer.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Plugins/UEWingman/Source/UEWingman/Private/WingActorComponent.cpp b/Plugins/UEWingman/Source/UEWingman/Private/WingActorComponent.cpp index f0b4a554..ac55e0a3 100644 --- a/Plugins/UEWingman/Source/UEWingman/Private/WingActorComponent.cpp +++ b/Plugins/UEWingman/Source/UEWingman/Private/WingActorComponent.cpp @@ -216,14 +216,14 @@ TMap UWingComponentReference::CalculateParentNames(USimpleConstruc UActorComponent* UWingComponentReference::GetImmutableTemplate() const { - if (Native) return FindComponentInCDO(BP->GeneratedClass, VariableName); - USCS_Node *Node = FindSCSNodeByName(BP, VariableName); - if (Node == nullptr) return nullptr; - FComponentKey Key(Node); + FoundComponent FC = FindComponent(BP, VariableName); + if (FC.Native) return FC.Native; + if (FC.SCS == nullptr) return nullptr; + FComponentKey Key(FC.SCS); 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); if (!ICH) continue; UActorComponent* Override = ICH->GetOverridenComponentTemplate(Key); @@ -234,12 +234,12 @@ UActorComponent* UWingComponentReference::GetImmutableTemplate() const UActorComponent* UWingComponentReference::GetMutableTemplate() const { - if (Native) return FindComponentInCDO(BP->GeneratedClass, VariableName); - USCS_Node* Node = FindSCSNodeByName(BP, VariableName); - if (!Node) return nullptr; - if (Node->GetSCS()->GetBlueprint() == BP) return Node->ComponentTemplate; + FoundComponent FC = FindComponent(BP, VariableName); + if (FC.Native) return FC.Native; + if (!FC.SCS) return nullptr; + if (FC.SCS->GetSCS()->GetBlueprint() == BP) return FC.SCS->ComponentTemplate; - FComponentKey Key(Node); + FComponentKey Key(FC.SCS); UInheritableComponentHandler* ICH = BP->GetInheritableComponentHandler(/*bCreateIfNecessary=*/ true); if (!ICH) return nullptr; UActorComponent* Override = ICH->GetOverridenComponentTemplate(Key); diff --git a/Plugins/UEWingman/Source/UEWingman/Private/WingTokenizer.cpp b/Plugins/UEWingman/Source/UEWingman/Private/WingTokenizer.cpp index fd37de9c..8a3f34b6 100644 --- a/Plugins/UEWingman/Source/UEWingman/Private/WingTokenizer.cpp +++ b/Plugins/UEWingman/Source/UEWingman/Private/WingTokenizer.cpp @@ -148,7 +148,7 @@ FName WingTokenizer::TokenizeIdentifier(FStringView &Rest, FString &Error) if (Ch == ' ') break; if (Ch == '.') { - if (Len < NAME_SIZE) Buffer[Len++] = Ch; + if (Len < NAME_SIZE) Buffer[Len++] = ' '; Rest = Rest.RightChop(1); continue; }