diff --git a/src/backend/looped/weapons/rapid_fire.cpp b/src/backend/looped/weapons/rapid_fire.cpp index 544aefbb..fea89e15 100644 --- a/src/backend/looped/weapons/rapid_fire.cpp +++ b/src/backend/looped/weapons/rapid_fire.cpp @@ -2,6 +2,7 @@ #include "natives.hpp" #include "gta/enums.hpp" #include "util/math.hpp" +#include "gui.hpp" namespace big { @@ -9,7 +10,7 @@ namespace big { if (g->weapons.rapid_fire) { - if(!HUD::IS_PAUSE_MENU_ACTIVE()) + if(!HUD::IS_PAUSE_MENU_ACTIVE() && !g_gui.m_opened && !PED::IS_PED_DEAD_OR_DYING(self::ped, true)) { if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_ATTACK)) { diff --git a/src/hooking.cpp b/src/hooking.cpp index c4c918c7..fa1ee2bf 100644 --- a/src/hooking.cpp +++ b/src/hooking.cpp @@ -65,6 +65,7 @@ namespace big detour_hook_helper::add("IMCD", g_pointers->m_invalid_mods_crash_detour); detour_hook_helper::add("CAC", g_pointers->m_constraint_attachment_crash); + detour_hook_helper::add("CBDSM", g_pointers->m_crash_bdsm); detour_hook_helper::add("UPAI", g_pointers->m_update_presence_attribute_int); detour_hook_helper::add("UPAS", g_pointers->m_update_presence_attribute_string); diff --git a/src/hooking.hpp b/src/hooking.hpp index 47c1e63d..6651dda4 100644 --- a/src/hooking.hpp +++ b/src/hooking.hpp @@ -99,6 +99,7 @@ namespace big static void invalid_mods_crash_detour(int64_t a1, int64_t a2, int a3, char a4); static std::int64_t constraint_attachment_crash(std::uintptr_t a1); + static std::int64_t crash_bdsm(std::int64_t a1, std::int64_t a2, unsigned int a3, int a4, std::int64_t a5); static bool update_presence_attribute_int(void* presence_data, int profile_index, char* attr, std::uint64_t value); static bool update_presence_attribute_string(void* presence_data, int profile_index, char* attr, char* value); diff --git a/src/hooks/protections/crash_bdsm.cpp b/src/hooks/protections/crash_bdsm.cpp new file mode 100644 index 00000000..2a6697e3 --- /dev/null +++ b/src/hooks/protections/crash_bdsm.cpp @@ -0,0 +1,11 @@ +#include "hooking.hpp" + +namespace big +{ + std::int64_t hooks::crash_bdsm(std::int64_t a1, std::int64_t a2, unsigned int a3, int a4, std::int64_t a5) + { + if (a3 <= 0) + a3 = 1; + return g_hooking->get_original()(a1, a2, a3, a4, a5); + } +} \ No newline at end of file diff --git a/src/pointers.cpp b/src/pointers.cpp index c5c68eeb..99a200de 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -670,6 +670,11 @@ namespace big m_constraint_attachment_crash = ptr.as(); }); + main_batch.add("CBDSM", "E8 ? ? ? ? 48 8B 47 10 4C 8B 8C 24", [this](memory::handle ptr) + { + m_crash_bdsm = ptr.add(1).rip().as(); + }); + auto mem_region = memory::module("GTA5.exe"); main_batch.run(mem_region); diff --git a/src/pointers.hpp b/src/pointers.hpp index 37190b0e..8a5e5edd 100644 --- a/src/pointers.hpp +++ b/src/pointers.hpp @@ -149,6 +149,7 @@ namespace big PVOID m_invalid_mods_crash_detour{}; PVOID m_constraint_attachment_crash{}; + PVOID m_crash_bdsm{}; int64_t** m_send_chat_ptr{}; functions::send_chat_message m_send_chat_message{};