From ae8a540730dd15db4f503ba22f5d78e9fb5009fa Mon Sep 17 00:00:00 2001 From: Aure7138 <100095051+Aure7138@users.noreply.github.com> Date: Sun, 30 Oct 2022 22:23:10 +0800 Subject: [PATCH] feat(self): add no collision(#541) --- BigBaseV2/src/backend/backend.cpp | 1 + BigBaseV2/src/backend/looped/looped.hpp | 1 + .../src/backend/looped/self/no_collision.cpp | 24 +++++++++++++++++++ BigBaseV2/src/core/globals.hpp | 3 +++ BigBaseV2/src/views/self/view_self.cpp | 10 +++++--- vendor/GTAV-Classes | 2 +- 6 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 BigBaseV2/src/backend/looped/self/no_collision.cpp diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index afc6e62b..cbe03ee0 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -32,6 +32,7 @@ namespace big looped::self_off_radar(); looped::self_police(); looped::self_super_run(); + looped::self_no_collision(); script::get_current()->yield(); } diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index b2367c28..bdf6093e 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -32,6 +32,7 @@ namespace big static void self_off_radar(); static void self_police(); static void self_super_run(); + static void self_no_collision(); static void session_local_time(); diff --git a/BigBaseV2/src/backend/looped/self/no_collision.cpp b/BigBaseV2/src/backend/looped/self/no_collision.cpp new file mode 100644 index 00000000..dafbfe6b --- /dev/null +++ b/BigBaseV2/src/backend/looped/self/no_collision.cpp @@ -0,0 +1,24 @@ +#include "backend/looped/looped.hpp" + +namespace big +{ + static bool bLastNoCollsion = false; + + void looped::self_no_collision() + { + if (g_local_player == nullptr) return; + + bool bNoCollsion = g->self.no_collision; + + if (bNoCollsion) + { + g_local_player->m_navigation->m_damp->m_bound_composite->m_bound_capsule_list->m_bound_capsule->m_collision = -1; + bLastNoCollsion = bNoCollsion; + } + else if (bNoCollsion != bLastNoCollsion) + { + g_local_player->m_navigation->m_damp->m_bound_composite->m_bound_capsule_list->m_bound_capsule->m_collision = 0.25; + bLastNoCollsion = bNoCollsion; + } + } +} diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 0dc5759e..c4fd82cd 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -151,6 +151,7 @@ namespace big bool noclip = false; bool off_radar = false; bool super_run = false; + bool no_collision = false; int wanted_level = 0; bool god_mode = false; bool proof_bullet = false; @@ -558,6 +559,7 @@ namespace big this->self.no_ragdoll = j["self"]["no_ragdoll"]; this->self.off_radar = j["self"]["off_radar"]; this->self.super_run = j["self"]["super_run"]; + this->self.no_collision = j["self"]["no_collision"]; this->settings.dev_dlc = j["settings"]["dev_dlc"]; this->settings.hotkeys.menu_toggle = j["settings"]["hotkeys"]["menu_toggle"]; @@ -824,6 +826,7 @@ namespace big { "no_ragdoll", this->self.no_ragdoll }, { "off_radar", this->self.off_radar }, { "super_run", this->self.super_run }, + { "no_collision", this->self.no_collision }, } }, { diff --git a/BigBaseV2/src/views/self/view_self.cpp b/BigBaseV2/src/views/self/view_self.cpp index b033dd41..8fa1d017 100644 --- a/BigBaseV2/src/views/self/view_self.cpp +++ b/BigBaseV2/src/views/self/view_self.cpp @@ -38,6 +38,12 @@ namespace big CUTSCENE::STOP_CUTSCENE_IMMEDIATELY(); }); + ImGui::SameLine(); + + components::button("Clean Player", [] { + entity::clean_ped(self::ped); + }); + ImGui::Separator(); components::sub_title("General"); @@ -69,9 +75,7 @@ namespace big ImGui::Checkbox("Keep Player Clean", &g->self.clean_player); - components::button("Clean Player", [] { - entity::clean_ped(self::ped); - }); + ImGui::Checkbox("No Collision", &g->self.no_collision); ImGui::EndGroup(); diff --git a/vendor/GTAV-Classes b/vendor/GTAV-Classes index 01101894..37361b42 160000 --- a/vendor/GTAV-Classes +++ b/vendor/GTAV-Classes @@ -1 +1 @@ -Subproject commit 011018945d7a04ff818bd6961875309c2099709a +Subproject commit 37361b421f70cf2a0cce33f2c7d277116474b7cd