Skip to content

Commit

Permalink
Merge pull request #606 from UE4SS-RE/uht-ordering-fix
Browse files Browse the repository at this point in the history
UHT - Fix SetupAttachment implementations randomly changing order
  • Loading branch information
narknon committed Aug 21, 2024
2 parents 0e84e2e + fbac9eb commit 1b5ff77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion UE4SS/src/SDKGenerator/UEHeaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,14 @@ namespace RC::UEGenerator
}
m_class_subobjects.clear();

// Sort the attachments alphabetically by the property name
std::vector<std::pair<FProperty*, std::tuple<std::wstring, std::wstring, bool>>> sorted_attachments(implementation_file.attachments.begin(), implementation_file.attachments.end());
std::sort(sorted_attachments.begin(), sorted_attachments.end(), [](const auto& a, const auto& b) {
return a.first->GetName() < b.first->GetName();
});

// Generate component attachments
for (auto attachment : implementation_file.attachments)
for (auto attachment : sorted_attachments)
{
if (get<2>(attachment.second) == false)
{
Expand Down
1 change: 1 addition & 0 deletions assets/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Reduced the likelihood of a crash happening on shutdown when at least one watch
Fixed constantly searching even if the search field is empty, and even if not on the tab ([UE4SS #475](https://github.com/UE4SS-RE/RE-UE4SS/pull/475))

### UHT Dumper
Fix SetupAttachment implementations randomly changing order ([UE4SS #606](https://github.com/UE4SS-RE/RE-UE4SS/pull/606)) - Buckminsterfullerene

### Lua API
Fixed FString use after free ([UE4SS #425](https://github.com/UE4SS-RE/RE-UE4SS/pull/425)) - localcc
Expand Down

0 comments on commit 1b5ff77

Please sign in to comment.