From 8d6152bcd50e4293a140c06c80194bb8eb3879dc Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 22 Dec 2021 14:26:54 +0100 Subject: [PATCH] fix(Hooking): Confusion between 2 different natives --- BigBaseV2/src/hooking.cpp | 2 +- BigBaseV2/src/hooking.hpp | 19 ++++++------- BigBaseV2/src/hooks/disable_error_screen.cpp | 30 +++++++++----------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 62bb9076..55bd5198 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -54,7 +54,7 @@ namespace big m_is_dlc_present_hook("IDP", g_pointers->m_is_dlc_present, &hooks::is_dlc_present), // Error Screen - m_error_screen_hook("ES", g_pointers->m_error_screen, &hooks::set_warning_message_with_header_and_substring_flags), + m_error_screen_hook("ES", g_pointers->m_error_screen, &hooks::set_warning_message_with_header), // Received Event m_received_event_hook("RE", g_pointers->m_received_event, &hooks::received_event), diff --git a/BigBaseV2/src/hooking.hpp b/BigBaseV2/src/hooking.hpp index d2d82bc7..5fa5f6e2 100644 --- a/BigBaseV2/src/hooking.hpp +++ b/BigBaseV2/src/hooking.hpp @@ -23,18 +23,17 @@ namespace big static LRESULT wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); static BOOL set_cursor_pos(int x, int y); - static void set_warning_message_with_header_and_substring_flags( - char* entryHeader, - char* entryLine1, + static void set_warning_message_with_header( + const char* entryHeader, + const char* entryLine1, int instructionalKey, - char* entryLine2, - BOOL p4, + const char* entryLine2, + bool p4, Any p5, - Any* additionalIntInfo, - const char* additionalTextInfoLine1, - const char* additionalTextInfoLine2, - BOOL background, - int errorCode + Any* showBackground, + Any* p7, + bool p8, + Any p9 ); static rage::eThreadState gta_thread_tick(GtaThread* a1, unsigned int a2); diff --git a/BigBaseV2/src/hooks/disable_error_screen.cpp b/BigBaseV2/src/hooks/disable_error_screen.cpp index 16dd6604..192f237a 100644 --- a/BigBaseV2/src/hooks/disable_error_screen.cpp +++ b/BigBaseV2/src/hooks/disable_error_screen.cpp @@ -4,34 +4,32 @@ namespace big { - void hooks::set_warning_message_with_header_and_substring_flags( - char* entryHeader, - char* entryLine1, + void hooks::set_warning_message_with_header( + const char* entryHeader, + const char* entryLine1, int instructionalKey, - char* entryLine2, - BOOL p4, + const char* entryLine2, + bool p4, Any p5, - Any* additionalIntInfo, - const char* additionalTextInfoLine1, - const char* additionalTextInfoLine2, - BOOL background, - int errorCode + Any* showBackground, + Any* p7, + bool p8, + Any p9 ) { if (SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME() == RAGE_JOAAT("shop_controller")) return; - return g_hooking->m_error_screen_hook.get_original()( + return g_hooking->m_error_screen_hook.get_original()( entryHeader, entryLine1, instructionalKey, entryLine2, p4, p5, - additionalIntInfo, - additionalTextInfoLine1, - additionalTextInfoLine2, - background, - errorCode + showBackground, + p7, + p8, + p9 ); } } \ No newline at end of file