Skip to content

Commit

Permalink
SDK: Speculative fix for broken create_userdata in RE4
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 2, 2023
1 parent da73475 commit 9f479ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/sdk/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void ResourceManager::update_pointers() {

for (const auto& pat : valid_patterns) {
for (auto ref = utility::scan(mod, pat); ref.has_value(); ref = utility::scan(*ref + 1, (mod_end - (*ref + 1)) - 100, pat)) {
auto func = utility::find_function_start(*ref);
auto func = utility::find_function_start_with_call(*ref);

if (func && *func != (uintptr_t)s_create_resource_fn) {
if (std::abs((ptrdiff_t)(*func - (uintptr_t)s_create_resource_fn)) < 0x50) {
Expand Down

0 comments on commit 9f479ea

Please sign in to comment.