Skip to content

Commit 065b207

Browse files
authored
Merge pull request #1103 from UE4SS-RE/FunctionFix
fix: Prevent Function::m_is_ready from being true if the function is in fact not ready
2 parents ad738d7 + 2634fb9 commit 065b207

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deps/first/Function/include/Function/Function.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace RC
4747
m_active_func = func_ptr;
4848
m_function_address = std::bit_cast<void*>(func_ptr);
4949
m_stored_original_func = m_active_func;
50-
m_is_ready = true;
50+
m_is_ready = m_function_address;
5151
}
5252

5353
// Assign a void* to this Function object as the function address
@@ -57,15 +57,15 @@ namespace RC
5757
m_active_func = std::bit_cast<FunctionSignature>(func_address);
5858
m_stored_original_func = m_active_func;
5959
m_function_address = func_address;
60-
m_is_ready = true;
60+
m_is_ready = func_address;
6161
}
6262

6363
// Assign a new function pointer (same type) to this Function object and store the old one
6464
auto assign_temp_address(FunctionSignature func_ptr) -> void
6565
{
6666
m_active_func = func_ptr;
6767
m_function_address = std::bit_cast<void*>(func_ptr);
68-
m_is_ready = true;
68+
m_is_ready = m_function_address;
6969
}
7070

7171
// Assign a new void* to this Function object and store the old function pointer
@@ -78,7 +78,7 @@ namespace RC
7878
}
7979
m_active_func = std::bit_cast<FunctionSignature>(address);
8080
m_function_address = address;
81-
m_is_ready = true;
81+
m_is_ready = address;
8282
}
8383

8484
// Reset the function pointer back to the original one

0 commit comments

Comments
 (0)