From 3394f8e65c79d0afa4224cb44b7e6b51ff0695de Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 22 Dec 2021 14:38:51 +0100 Subject: [PATCH] feat(Hook): Dismiss shop_controller error instead of silencing it --- BigBaseV2/src/hooks/disable_error_screen.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/BigBaseV2/src/hooks/disable_error_screen.cpp b/BigBaseV2/src/hooks/disable_error_screen.cpp index 192f237a..90030b71 100644 --- a/BigBaseV2/src/hooks/disable_error_screen.cpp +++ b/BigBaseV2/src/hooks/disable_error_screen.cpp @@ -1,6 +1,7 @@ #include "gta/joaat.hpp" #include "hooking.hpp" #include "natives.hpp" +#include "script_global.hpp" namespace big { @@ -17,7 +18,14 @@ namespace big Any p9 ) { - if (SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME() == RAGE_JOAAT("shop_controller")) return; + if (SCRIPT::GET_HASH_OF_THIS_SCRIPT_NAME() == RAGE_JOAAT("shop_controller") && strcmp(entryLine1, "CTALERT_F_2") == 0) + { + // dismisses popup instead of killing it silently + *script_global(4529830).as() = 0; + + // we still return to prevent our original call from rendering a single frame + return; + } return g_hooking->m_error_screen_hook.get_original()( entryHeader,