Skip to content

Commit

Permalink
fix: FString __tostring metamethod compile
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyrth committed Oct 11, 2024
1 parent 4b7de0c commit 7d804b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions UE4SS/src/LuaType/LuaFString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ namespace RC::LuaType

std::string name;

auto* fstring = lua.get_userdata<LuaType::FString>().get_remote_cpp_object();
auto& fstring = lua.get_userdata<LuaType::FString>().get_local_cpp_object();
auto* string_data = fstring.GetCharArray();

name.append(ClassName::ToString());
name.append(std::format(" \"{}\": {:016X}", to_string(fstring->GetCharArray()), reinterpret_cast<uintptr_t>(fstring)));
name.append(std::format(" \"{}\": {:016X}", string_data ? to_string(string_data) : "", reinterpret_cast<uintptr_t>(&fstring)));

lua.set_string(name);

Expand Down

0 comments on commit 7d804b7

Please sign in to comment.