Skip to content

Commit

Permalink
MHWilds: Fix some runtime type lookups causing crashes/Lua errors
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Nov 1, 2024
1 parent 257bee3 commit 272c810
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shared/sdk/RETypeDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,12 +945,14 @@ ::REManagedObject* RETypeDefinition::get_runtime_type() const {
struct FakeObject {
const TypeDefinitionHolder* holder{nullptr};
} fake_obj;

fake_obj.holder = &holder;
holder.t = this;

return fn->call<::REManagedObject*>(sdk::get_thread_context(), &fake_obj);
}

return nullptr;
}

auto context = sdk::get_thread_context();
Expand Down

0 comments on commit 272c810

Please sign in to comment.