diff --git a/scripts/cpr.cmake b/scripts/cpr.cmake index ab61d5b9..6918b58f 100644 --- a/scripts/cpr.cmake +++ b/scripts/cpr.cmake @@ -1,6 +1,7 @@ include(FetchContent) set(BUILD_TESTING_BEFORE ${BUILD_TESTING}) +set(CURL_DISABLE_TESTS OFF) FetchContent_Declare( cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git diff --git a/src/core/globals.hpp b/src/core/globals.hpp index 6fa1ffe1..c0c1356f 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -633,10 +633,17 @@ namespace big player_count_filter_minimum, player_count_filter_maximum, sort_method, sort_direction, replace_game_matchmaking) } session_browser{}; + struct ugc + { + bool infinite_model_memory; + + NLOHMANN_DEFINE_TYPE_INTRUSIVE(ugc, infinite_model_memory) + } ugc{}; + NLOHMANN_DEFINE_TYPE_INTRUSIVE(menu_settings, debug, tunables, notifications, player, protections, self, session, settings, spawn_vehicle, clone_pv, - spawn_ped, spoofing, vehicle, weapons, window, context_menu, esp, session_browser) + spawn_ped, spoofing, vehicle, weapons, window, context_menu, esp, session_browser, ugc) }; inline auto g = menu_settings(); diff --git a/src/gta/natives.hpp b/src/gta/natives.hpp index 0e4ae3a1..5126d74e 100644 --- a/src/gta/natives.hpp +++ b/src/gta/natives.hpp @@ -47,6 +47,12 @@ namespace rage { *reinterpret_cast>*>(m_return_value) = std::forward(value); } + + template + void set_return_value(T& value) + { + *reinterpret_cast>*>(m_return_value) = std::forward(value); + } protected: void *m_return_value; std::uint32_t m_arg_count; diff --git a/src/native_hooks/all_scripts.hpp b/src/native_hooks/all_scripts.hpp index a19249ec..c520acbd 100644 --- a/src/native_hooks/all_scripts.hpp +++ b/src/native_hooks/all_scripts.hpp @@ -27,12 +27,13 @@ namespace big void IS_DLC_PRESENT(rage::scrNativeCallContext* src) { const auto hash = src->get_arg(0); - - bool return_value = DLC::IS_DLC_PRESENT(hash); + + BOOL return_value = DLC::IS_DLC_PRESENT(hash); + if (hash == 0x96F02EE6) return_value = return_value || g.settings.dev_dlc; - src->set_return_value(return_value); + src->set_return_value(return_value); } void NETWORK_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(rage::scrNativeCallContext* src) diff --git a/src/native_hooks/creator.hpp b/src/native_hooks/creator.hpp index f7bb62bc..1645c485 100644 --- a/src/native_hooks/creator.hpp +++ b/src/native_hooks/creator.hpp @@ -35,5 +35,13 @@ namespace big src->set_return_value(std::move(model)); } + + void GET_USED_CREATOR_BUDGET(rage::scrNativeCallContext* src) + { + if (g.ugc.infinite_model_memory) + src->set_return_value(0); + else + src->set_return_value(STREAMING::GET_USED_CREATOR_BUDGET()); + } } } \ No newline at end of file diff --git a/src/native_hooks/native_hooks.cpp b/src/native_hooks/native_hooks.cpp index e2b264cb..000af4da 100644 --- a/src/native_hooks/native_hooks.cpp +++ b/src/native_hooks/native_hooks.cpp @@ -133,6 +133,13 @@ namespace big add_native_detour(RAGE_JOAAT("fm_capture_creator"), 0x9F47B058362C84B5, creator::GET_ENTITY_MODEL); add_native_detour(RAGE_JOAAT("fm_deathmatch_creator"), 0x9F47B058362C84B5, creator::GET_ENTITY_MODEL); add_native_detour(RAGE_JOAAT("fm_lts_creator"), 0x9F47B058362C84B5, creator::GET_ENTITY_MODEL); + + // Infinite Model Memory + add_native_detour(RAGE_JOAAT("fm_race_creator"), 0x3D3D8B3BE5A83D35, creator::GET_USED_CREATOR_BUDGET); + add_native_detour(RAGE_JOAAT("fm_capture_creator"), 0x3D3D8B3BE5A83D35, creator::GET_USED_CREATOR_BUDGET); + add_native_detour(RAGE_JOAAT("fm_deathmatch_creator"), 0x3D3D8B3BE5A83D35, creator::GET_USED_CREATOR_BUDGET); + add_native_detour(RAGE_JOAAT("fm_lts_creator"), 0x3D3D8B3BE5A83D35, creator::GET_USED_CREATOR_BUDGET); + add_native_detour(RAGE_JOAAT("fm_survival_creator"), 0x3D3D8B3BE5A83D35, creator::GET_USED_CREATOR_BUDGET); for (auto& entry : *g_pointers->m_script_program_table) if (entry.m_program) diff --git a/src/util/mobile.hpp b/src/util/mobile.hpp index f979078b..9a158831 100644 --- a/src/util/mobile.hpp +++ b/src/util/mobile.hpp @@ -43,6 +43,16 @@ namespace big::mobile { *script_global(scr_globals::mechanic_global).at(888).as() = 1; } + + inline void request_backup_helicopter() + { + *script_global(scr_globals::mechanic_global).at(4484).as() = 1; + } + + inline void request_airstrike() + { + *script_global(scr_globals::mechanic_global).at(4485).as() = 1; + } } namespace mors_mutual @@ -85,6 +95,14 @@ namespace big::mobile } } + namespace ceo_abilities + { + inline void request_bullshark_testosterone() + { + *script_global(2672505).at(3689).as() = 1; + } + } + namespace mechanic { inline Vehicle get_personal_vehicle() diff --git a/src/views/core/view_heading.cpp b/src/views/core/view_heading.cpp index 2999d1a3..d2f79054 100644 --- a/src/views/core/view_heading.cpp +++ b/src/views/core/view_heading.cpp @@ -23,7 +23,8 @@ namespace big g_fiber_pool->queue_job([] { for (auto& command : g_looped_commands) - command->on_disable(); + if (command->is_enabled()) + command->on_disable(); g_running = false; }); diff --git a/src/views/self/view_mobile.cpp b/src/views/self/view_mobile.cpp index 5b6ddb9b..b6ad7e6c 100644 --- a/src/views/self/view_mobile.cpp +++ b/src/views/self/view_mobile.cpp @@ -9,7 +9,6 @@ namespace big ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always); components::sub_title("Merryweather"); - ImGui::Separator(); components::button("Request Ammo Drop", [] { @@ -20,6 +19,15 @@ namespace big mobile::merry_weather::request_helicopter_pickup(); }); + components::button("Request Backup Helicopter", [] { + mobile::merry_weather::request_backup_helicopter(); + }); + + components::button("Request Airstrike", [] { + mobile::merry_weather::request_airstrike(); + }); + + components::sub_title("Mors Mutual"); ImGui::Separator(); components::button("Mors Mutual Fix All Vehicles", [] { @@ -28,5 +36,13 @@ namespace big std::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") ); }); + + components::sub_title("CEO Abilities"); + ImGui::Separator(); + + components::button("Bullshark Testosterone", [] { + mobile::ceo_abilities::request_bullshark_testosterone(); + }); + } } diff --git a/src/views/world/view_creator.cpp b/src/views/world/view_creator.cpp index 7f497b5e..6367e856 100644 --- a/src/views/world/view_creator.cpp +++ b/src/views/world/view_creator.cpp @@ -114,5 +114,13 @@ namespace big components::button("Deathmatch", [] { scripts::start_creator_script(RAGE_JOAAT("fm_deathmatch_creator")); }); ImGui::SameLine(); components::button("LTS", [] { scripts::start_creator_script(RAGE_JOAAT("fm_lts_creator")); }); ImGui::EndGroup(); + + components::sub_title("Creator Options"); + ImGui::BeginGroup(); + ImGui::Checkbox("Infinite Model Memory", &g.ugc.infinite_model_memory); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("Infinite Model Memory is only useful if dev mode is not activated"); + + ImGui::EndGroup(); } }