Skip to content

Commit

Permalink
SDK: Fix AddObject not getting found in some cases (compiler stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 29, 2023
1 parent b5236b8 commit 951cf6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion shared/sdk/UObjectBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ void UObjectBase::update_offsets_post_uobjectarray() {

for (auto ref : vtable_references) {
if (!utility::find_mnemonic_in_path(ref + 4, 100, "CALL", false)) {
SPDLOG_INFO("Skipping reference at 0x{:X} because it doesn't call anything");
continue;
}

Expand Down Expand Up @@ -362,7 +363,7 @@ void UObjectBase::update_offsets_post_uobjectarray() {
return utility::ExhaustionResult::STEP_OVER;
}

if (std::string_view{ctx.instrux.Mnemonic}.starts_with("MOV")) {
if (std::string_view{ctx.instrux.Mnemonic}.starts_with("MOV") || std::string_view{ctx.instrux.Mnemonic}.starts_with("OR")) {
for (auto i = 0; i < ctx.instrux.OperandsCount; ++i) {
const auto& op = ctx.instrux.Operands[i];

Expand All @@ -379,6 +380,8 @@ void UObjectBase::update_offsets_post_uobjectarray() {
if (correct_ref) {
break;
}

SPDLOG_INFO("Skipping reference at 0x{:X} because it doesn't reference 0xFFFFFFFF", ref);
}

if (!correct_ref) {
Expand Down
2 changes: 1 addition & 1 deletion src/mods/UObjectHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ void UObjectHook::ui_handle_object(sdk::UObject* object) {
ui_handle_material_interface(object);
}

static auto widget_component_t = sdk::find_uobject<sdk::UClass>(L"Class /Script/UMG.WidgetComponent");
static const auto widget_component_t = sdk::find_uobject<sdk::UClass>(L"Class /Script/UMG.WidgetComponent");

if (uclass->is_a(widget_component_t)) {
if (ImGui::Button("Set to Screen Space")) {
Expand Down

0 comments on commit 951cf6a

Please sign in to comment.