Skip to content

Commit

Permalink
SDK: Fix FFieldClass::s_name_offset on old UE builds
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 22, 2023
1 parent b14e344 commit 593463f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions shared/sdk/FName.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ std::wstring FName::to_string() const {
fn(this, &buffer);

if (buffer.data != nullptr) {
std::wstring result = buffer.data;
return result;
return buffer.data;
}

return std::wstring{};
Expand Down
2 changes: 2 additions & 0 deletions shared/sdk/TArray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct TArray {
return;
}

// TODO: call destructors?

if (auto m = FMalloc::get(); m != nullptr) {
m->free(data);
}
Expand Down
2 changes: 2 additions & 0 deletions shared/sdk/UClass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void UStruct::resolve_field_offsets(uint32_t child_search_start) {

if (class_offset) {
FField::s_class_offset = *class_offset - (uintptr_t)potential_field;
FFieldClass::s_name_offset = UObjectBase::s_fname_offset;
found_ufield_class_offset = true;
SPDLOG_INFO("[UStruct] Found FField/UField Class at offset 0x{:X}", FField::s_class_offset);
}
Expand All @@ -110,6 +111,7 @@ void UStruct::resolve_field_offsets(uint32_t child_search_start) {

if (class_offset) {
FField::s_class_offset = *class_offset - (uintptr_t)potential_field;
FFieldClass::s_name_offset = UObjectBase::s_fname_offset;
found_ufield_class_offset = true;
SPDLOG_INFO("[UStruct] Found FField/UField Class at offset 0x{:X}", FField::s_class_offset);
}
Expand Down

0 comments on commit 593463f

Please sign in to comment.